Skip to content

feat(workflows): output schema MCP#1221

Open
kappa90 wants to merge 1 commit intomainfrom
03-12-feat_workflows_output_schema_mcp
Open

feat(workflows): output schema MCP#1221
kappa90 wants to merge 1 commit intomainfrom
03-12-feat_workflows_output_schema_mcp

Conversation

@kappa90
Copy link
Contributor

@kappa90 kappa90 commented Mar 12, 2026

TL;DR

Added structured output support to the agent server through a new MCP server that provides a submit_result tool for agents to return JSON Schema-validated results. This is used by workflows agents that need to return a structured output defined by the user.

What changed?

  • Added ResultMcpServer class that runs an HTTP MCP server exposing a submit_result tool
  • Added --outputSchema CLI option to accept JSON Schema for structured output validation
  • Modified agent initialization to conditionally start the result MCP server and include it in the MCP servers list
  • Updated system prompt generation to provide structured output instructions when output schema is configured
  • Added automatic task completion marking when structured results are submitted
  • Added proper cleanup of the result MCP server during agent shutdown

How to test?

  1. Start the agent server with --outputSchema '{"type": "object", "properties": {"answer": {"type": "string"}}}'
  2. Send a task to the agent that requires structured output
  3. Verify the agent uses the submit_result tool to return data conforming to the schema
  4. Check that the task run is marked as completed and the output is saved to the PostHog API

Why make this change?

This enables agents to return structured, validated results instead of only creating PRs or branches.

Copy link
Contributor Author

kappa90 commented Mar 12, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@kappa90 kappa90 marked this pull request as ready for review March 13, 2026 09:59
@kappa90 kappa90 force-pushed the 03-12-feat_workflows_output_schema_mcp branch 2 times, most recently from d43af83 to a21edfa Compare March 13, 2026 10:03
@kappa90 kappa90 force-pushed the 03-12-feat_workflows_output_schema_mcp branch from a21edfa to 2361d48 Compare March 13, 2026 10: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.

1 participant