Skip to content

Expose API complexity metadata in MCP tool results#350

Open
omribz156 wants to merge 1 commit into
mondaycom:masterfrom
omribz156:codex/complexity-metadata
Open

Expose API complexity metadata in MCP tool results#350
omribz156 wants to merge 1 commit into
mondaycom:masterfrom
omribz156:codex/complexity-metadata

Conversation

@omribz156
Copy link
Copy Markdown

Closes #242.

Summary

  • Adds a small MCP-side complexity tracker around monday API requests made during tool execution.
  • Auto-adds the root complexity { query before after reset_in_x_seconds } selection when a tool query/mutation does not already request it.
  • Returns the latest complexity value through MCP _meta.complexity, and includes _meta.complexities when a tool makes multiple API calls.
  • Keeps existing tool payloads stable by removing only the auto-injected complexity field from structuredContent.
  • Preserves existing tool-provided metadata in MCP-formatted responses.

Verification

  • jest -c jest.config.ts --runTestsByPath C:\projects\oss-supporter\codex\slices\durable\mondaycom-mcp\2026-05-21-complexity-metadata\repo\packages\agent-toolkit\src\mcp\toolkit.test.ts --runInBand
  • prettier --check packages/agent-toolkit/src/mcp/toolkit.ts packages/agent-toolkit/src/mcp/toolkit.test.ts --ignore-path .prettierignore
  • eslint packages/agent-toolkit/src/mcp/toolkit.ts packages/agent-toolkit/src/mcp/toolkit.test.ts --ignore-path .eslintignore
  • git diff --check

Notes: I also tried yarn workspace @mondaydotcomorg/agent-toolkit build, but this local reused-dependency setup is missing @rollup/plugin-typescript. A full tsc -p packages/agent-toolkit/tsconfig.json --noEmit also still hits the existing deep type-instantiation error in src/openai/toolkit.ts.

This was implemented with Codex assistance, with the patch kept focused and manually reviewed before sending.

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.

Feature: Expose API complexity data in tool responses

1 participant