Skip to content

feat(mcp): add structured tool output (outputSchema + structuredContent) for machine-readable responses #137

@bug-ops

Description

@bug-ops

Description

MCP 2025-11-25 introduced structured tool output: tools can declare an outputSchema (JSON Schema for an object) and return structuredContent alongside the human-readable content. This enables programmatic consumers to parse tool responses reliably without scraping text.

rmcp 1.5.0 supports this via output_schema() method on the Tool trait and CallToolResult::with_structured(value). No new dependencies required.

mcpls tools currently return all results as plain text (Markdown / JSON strings inside text content). For tools like get_diagnostics, hover, definition, and document_symbols, a structured output would allow AI agents and downstream tooling to consume results without text parsing.

Expected Behavior

High-value tools (get_diagnostics, go_to_definition, find_references, document_symbols) declare an outputSchema and return both content (text, for backwards compat) and structuredContent (typed JSON object).

Actual Behavior

All tools return text-only content. No outputSchema is declared.

Scope

Start with get_diagnostics as a pilot — its output structure (file, line, column, severity, message) is stable and well-defined. Expand to other tools incrementally.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4Nice-to-have: research ideas, future enhancementsenhancementNew feature or requestmcpls-coremcpls-core crate changes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions