Skip to content

mcp: validation errors name spaceId, replyToMsgId, offsetId and afterChatId - #184

Merged
morajabi merged 1 commit into
mainfrom
claude/mcp-id-error-fields
Dec 1, 2026
Merged

morajabi merged 1 commit into
mainfrom
claude/mcp-id-error-fields

Conversation

@morajabi

Copy link
Copy Markdown
Contributor

Four MCP tool arguments were parsed with parseChatId. A bad value was reported as invalid chatId, even though the caller never sent a chatId. Agents read these errors to fix their call, so the wrong name sent them after the wrong field. This came from the 2026-11-25 app-wide audit.

Tool Field
conversations.create spaceId
messages.send replyToMsgId
messages.list offsetId
conversations.list afterChatId

Each one now uses parseInlineId(value, "<field>"). The validation is the same as before; only the error message changes. The tool schemas and results are unchanged.

Tests

  • 8 new cases: the 4 fields, each under both the legacy and submission-v2 contracts. Each checks that the error names the field, doesn't say chatId, and that no Inline call is made. All 8 fail without the fix.
  • bun run test in packages/mcp: 20 files, 500/500. typecheck and lint are clean.

🤖 Generated with Claude Code

…ChatId

conversations.create parsed spaceId, messages.send parsed replyToMsgId,
messages.list parsed offsetId and conversations.list parsed afterChatId
with parseChatId, so a bad value was reported as "invalid chatId". They
now use parseInlineId with their own field name. Tests cover both tool
contracts and check no Inline call is made.
@morajabi
morajabi force-pushed the claude/mcp-id-error-fields branch from 7b641b1 to 0c75ada Compare December 1, 2026 10:19
@morajabi
morajabi merged commit bc23f93 into main Dec 1, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant