Skip to content

TW-4925: MCP proxy normalizes list_events and availability arguments#78

Merged
qasim-nylas merged 1 commit into
mainfrom
feature/TW-4925-mcp-normalize-arguments
May 12, 2026
Merged

TW-4925: MCP proxy normalizes list_events and availability arguments#78
qasim-nylas merged 1 commit into
mainfrom
feature/TW-4925-mcp-normalize-arguments

Conversation

@qasim-nylas
Copy link
Copy Markdown
Collaborator

Summary

  • MCP proxy now coerces integer start/end to strings for list_events — LLMs naturally send 1747065600 but the upstream schema expects "1747065600"
  • Rounds availability timestamps to 5-minute boundaries — start_time floored, end_time ceiled to multiples of 300s
  • Deduplicates AGENTS.md to reference CLAUDE.md and docs/ instead of repeating content

Details

Two silent failures discovered via deep MCP test harness:

  1. list_events rejected "start": 1747065600 with type "integer", want "string" — every LLM will produce this
  2. availability rejected raw time.Now() with 'start_time' must be a multiple of 5 minutes — every LLM will produce this

Added normalizeToolArguments() to the proxy pipeline after grant injection. Only targets list_events and availability — all other tools pass through unchanged.

Test plan

  • 172 normalization test cases (type coercion, rounding, exotic types, concurrency, idempotency, cross-tool isolation)
  • 286 total MCP package tests pass with -race
  • Verified against live Nylas MCP server — both tools now succeed with LLM-generated arguments
  • make ci passes (fmt, vet, lint, unit, race, security, vuln, build)

…before forwarding

LLMs send integer start/end for list_events (schema expects strings) and
unaligned timestamps for availability (API requires 5-min multiples).
The proxy now coerces types and rounds timestamps transparently.
@qasim-nylas qasim-nylas requested a review from AaronDDM May 12, 2026 13:45
Copy link
Copy Markdown
Collaborator

@AaronDDM AaronDDM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@qasim-nylas qasim-nylas merged commit e2a0eba into main May 12, 2026
5 of 6 checks passed
@qasim-nylas qasim-nylas deleted the feature/TW-4925-mcp-normalize-arguments branch May 12, 2026 14:09
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.

2 participants