Skip to content

Add graph-level input schema support for MCP tools/list #31

Description

@madeinplutofabio

Summary

Currently v0 of ncp-mcp-server exposes every tool's inputSchema as {"type":"object"}. That is honest (any object accepted, passed verbatim as the graph root input), but MCP-compatible hosts often use the schema to render input forms or guide LLMs. Richer schemas would noticeably improve adopter UX.

Why this matters

  • A real input schema lets hosts render better input forms.
  • LLMs use the schema as part of tool-selection reasoning.
  • v0 deferred this intentionally (per docs/MCP_ADAPTER.md §4) until adopter feedback shaped the schema strategy. That feedback is now arriving.

Acceptance criteria

  • Design how graph manifests can optionally declare a graph-level input JSON Schema (new manifest field, for example input_schema:).
  • If absent, preserve current {"type":"object"} behavior. No breaking change for existing graphs.
  • Expose the declared schema verbatim in MCP tools/list inputSchema for tools whose graphs declare one.
  • Add tests for: declared schema (passes through); missing schema (falls back to {"type":"object"}); invalid schema (graph manifest rejected at startup).
  • Document the behavior in docs/MCP_ADAPTER.md §4.

Open questions for the design

  • Should the schema validate inputs at the adapter, or pass through and let the graph fail with INVALID_INPUT?
  • Does the schema field belong in graph.yaml directly, or in a sidecar file?

Where to read

  • docs/MCP_ADAPTER.md §4 for the current input-schema contract
  • crates/ncp-mcp-server/src/server.rs for list_tools and call_tool handlers
  • runtime/src/manifest.rs for graph manifest structure

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:mcpMCP adapter and MCP integration worktype:enhancementFeature enhancement or extension

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions