Skip to content

fix(mcp): add minItems/maxItems to ctx_get ids schema#35

Open
koteshyelamati wants to merge 1 commit into
agentctxhq:mainfrom
koteshyelamati:main
Open

fix(mcp): add minItems/maxItems to ctx_get ids schema#35
koteshyelamati wants to merge 1 commit into
agentctxhq:mainfrom
koteshyelamati:main

Conversation

@koteshyelamati

Copy link
Copy Markdown

The ctx_get handler enforces that ids must have 1-GET_IDS_MAX elements, but the inputSchema declared neither minItems nor maxItems. MCP clients had no way to know the array bounds up front.

Adds minItems: 1 and maxItems: GET_IDS_MAX to the ids schema and updates the description to mention the lower bound. Runtime checks in ctxGet remain as the authoritative guard.

Closes #34

Summary

Related Issues

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Docs / chore

How Has This Been Tested?

Checklist

  • My code builds and runs locally without errors
  • I have added or updated tests where applicable
  • I have updated relevant documentation
  • I have read CONTRIBUTING.md and my contribution aligns with its guidelines.

The ctx_get handler enforces that ids must have 1-GET_IDS_MAX elements, but the inputSchema declared neither minItems nor maxItems. MCP clients had no way to know the array bounds up front.

Adds minItems: 1 and maxItems: GET_IDS_MAX to the ids schema and updates the description to mention the lower bound. Runtime checks in ctxGet remain as the authoritative guard.

Closes agentctxhq#34
@Deepam02

Deepam02 commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

@koteshyelamati thanks for the contribution

The pr is missing the test assertion in test/mcp/tools.test.ts that the issue explicitly requires

@koteshyelamati

Copy link
Copy Markdown
Author

Thanks @Deepam02 — you're right. I'll add the test assertion in test/mcp/tools.test.ts covering the new minItems/maxItems bounds on the ids schema, as the issue requires, and push it to this PR.

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.

ctx_get MCP input schema doesn't advertise the id-count limits its handler enforces

2 participants