Skip to content

DF0014: Invalid Agent Field ​

Experimental

The agent-native surface is experimental and may change without a major version bump until it stabilizes.

Message ​

RPC function "{name}" has an invalid agent field — description must be a non-empty string.

Cause ​

An RPC function was defined with an agent field (opting it in for exposure to agents via the MCP adapter), but the required description property is missing or empty.

Agents rely on the description to decide when to invoke a tool. Empty or placeholder descriptions would produce unusable agent surface.

Example ​

ts
defineRpcFunction({
  name: 'rolldown-get-session-summary',
  type: 'query',
  agent: {
    description: '', // ❌ empty
  },
  // ...
})

Fix ​

Provide a non-empty description (~1–3 sentences) explaining what the tool does and when agents should invoke it:

ts
defineRpcFunction({
  name: 'rolldown-get-session-summary',
  type: 'query',
  agent: {
    description: 'Summarize a Rolldown build session by its id. Safe to call freely.',
  },
  // ...
})

If you didn't intend for this function to be agent-exposed, remove the agent field entirely (default-deny).

Source ​

Released under the MIT License.