Skip to content

feat: tighten mcp tool enum parameter typing#61

Merged
HumanBean17 merged 1 commit into
masterfrom
feat/mcp-v2-literal-types
May 8, 2026
Merged

feat: tighten mcp tool enum parameter typing#61
HumanBean17 merged 1 commit into
masterfrom
feat/mcp-v2-literal-types

Conversation

@HumanBean17
Copy link
Copy Markdown
Owner

Summary

  • tighten MCP tool parameter typing with Literal[...] so constrained values (search.table, find.kind, neighbors.direction, neighbors.edge_types[]) reject invalid input at parse time
  • introduce shared EdgeType literal alias in mcp_v2.py and wire server.py tool signatures to the same edge-label taxonomy
  • add regression coverage for invalid enum-like values and a schema-introspection test that asserts enum emission in tool input schemas

Test plan

  • .venv/bin/python -m pytest tests/test_mcp_v2.py -q
  • .venv/bin/python -m pytest tests/test_mcp_tools.py -q
  • .venv/bin/python -m pytest tests -v
  • .venv/bin/ruff check .

Made with Cursor

Use Literal-backed enums for constrained MCP parameters so invalid values fail at parse time and tool schemas expose enum hints. Add negative validation and schema assertions to lock the behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
@HumanBean17 HumanBean17 merged commit 3dd713a into master May 8, 2026
@HumanBean17 HumanBean17 deleted the feat/mcp-v2-literal-types branch May 10, 2026 21:17
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.

Tighten MCP tool parameter types: use Literal[...] for direction / kind / table / edge_types

1 participant