[safeoutputs] Clarify flat MCP arguments and add SafeOutputMCP wrapped-argument fallback#37208
Conversation
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
…p guidance Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
create_discussion and shared noop guidance
|
@copilot if the SafeOutputMCP server cannot find the type field, it should check for a child that matches the tool name and use that child field. It should be resilient to these kinds of errors that agents tend to produce. This handling should be implemented at the SafeOutputMCP level. |
There was a problem hiding this comment.
Pull request overview
Clarifies safe-output / MCP tool-call argument shapes to prevent intermittent schema failures caused by agents sending wrapped arguments (e.g., {"noop": {...}} / {"create_discussion": {...}}) instead of flat tool arguments.
Changes:
- Updated
create_discussiontool descriptions to explicitly require flat arguments (title,body) in both the source-of-truth and runtime tool schema JSON. - Corrected shared
noopguidance to show flat MCP tool arguments and explicitly forbid wrapping undernoop. - Regenerated selected
.lock.ymlworkflows so the updated shared guidance is propagated into runtime prompts.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/js/safe_outputs_tools.json | Adds explicit flat-argument guidance to create_discussion tool description. |
| actions/setup/js/safe_outputs_tools.json | Mirrors the create_discussion flat-argument guidance in the runtime copy. |
| .github/workflows/shared/noop-reminder.md | Updates the shared noop example to flat arguments and forbids wrapping under noop. |
| .github/workflows/smoke-claude.lock.yml | Regenerated prompt text to include the corrected noop guidance/example. |
| .github/workflows/daily-fact.lock.yml | Regenerated prompt text (and related generated blocks) to include corrected noop guidance/example. |
| .github/workflows/daily-cache-strategy-analyzer.lock.yml | Regenerated lock (metadata + generated block hashes) to propagate updated shared content. |
| .github/workflows/daily-agent-of-the-day-blog-writer.lock.yml | Regenerated lock metadata to reflect updated shared content propagation. |
| .github/workflows/copilot-pr-nlp-analysis.lock.yml | Regenerated lock metadata to reflect updated shared content propagation. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 8/8 changed files
- Comments generated: 3
| **Important**: If no action is needed after completing your analysis, you **MUST** call the `noop` safe-output tool with a brief explanation. Pass arguments directly to the tool. Do **NOT** wrap them under a `noop` key. Failing to call any safe-output tool is the most common cause of safe-output workflow failures. | ||
|
|
||
| ```json | ||
| {"noop": {"message": "No action needed: [brief explanation of what was analyzed and why]"}} | ||
| {"message": "No action needed: [brief explanation of what was analyzed and why]"} | ||
| ``` |
| { | ||
| "name": "create_discussion", | ||
| "description": "Create a GitHub discussion for announcements, Q&A, reports, status updates, or community conversations. Use this for content that benefits from threaded replies, doesn't require task tracking, or serves as documentation. For actionable work items that need assignment and status tracking, use create_issue instead.", | ||
| "description": "Create a GitHub discussion for announcements, Q&A, reports, status updates, or community conversations. Use this for content that benefits from threaded replies, doesn't require task tracking, or serves as documentation. For actionable work items that need assignment and status tracking, use create_issue instead. Arguments must be flat tool arguments (title, body), not nested under create_discussion.", | ||
| "inputSchema": { |
| { | ||
| "name": "create_discussion", | ||
| "description": "Create a GitHub discussion for announcements, Q&A, reports, status updates, or community conversations. Use this for content that benefits from threaded replies, doesn't require task tracking, or serves as documentation. For actionable work items that need assignment and status tracking, use create_issue instead.", | ||
| "description": "Create a GitHub discussion for announcements, Q&A, reports, status updates, or community conversations. Use this for content that benefits from threaded replies, doesn't require task tracking, or serves as documentation. For actionable work items that need assignment and status tracking, use create_issue instead. Arguments must be flat tool arguments (title, body), not nested under create_discussion.", | ||
| "inputSchema": { |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Addressed in c3e5e04. SafeOutputMCP now unwraps a child object whose key matches the invoked tool name before required-field validation, and the safe-outputs stdio and HTTP servers both opt into that fallback. |
create_discussion and shared noop guidance|
@copilot Add logging and unwrapping so we can confirm it occurred. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agents were intermittently calling
create_discussionwith wrapped arguments ({"create_discussion": {...}}) instead of flat MCP tool arguments, causing first-attempt schema failures (missing or empty 'title', 'body') before retry recovery. The issue came from shared guidance that modeled wrapped NDJSON shape as if it were MCP call shape.This change now addresses the problem in both places:
by correcting the guidance that teaches agents what to send, and
by making SafeOutputMCP resilient when agents still send wrapped arguments.
Tool schema guidance (
create_discussion)create_discussiondescriptions in both source-of-truth and runtime copies:pkg/workflow/js/safe_outputs_tools.jsonactions/setup/js/safe_outputs_tools.jsontitle,body) and not nested undercreate_discussion.Shared noop example correction
.github/workflows/shared/noop-reminder.mdto show flat MCP tool-call arguments and explicitly forbid wrapping undernoop.Runtime prompt propagation
.lock.ymlworkflows so the corrected shared noop guidance is reflected in generated runtime prompts.SafeOutputMCP wrapped-argument recovery
actions/setup/js/safe_outputs_mcp_server.cjsactions/setup/js/safe_outputs_mcp_server_http.cjsValidation
Example of corrected call shape:
{"message": "No action needed: [brief explanation]"}(Previously shown as wrapped form:
{"noop": {"message": "..."}}.)