Skip to content

Hosted MCP reports missing config paths as tool not found #394

Closed

Description

@franciscpd

Summary

When a managed session calls compozy__config_get for an absent allowed path, the structured reason is correctly config_path_not_found, but the hosted MCP error text says tool not found. The contradictory result can make any agent, including one published by an installed extension, conclude that the available tool itself does not exist.

Generic reproduction

  1. Start a managed agent session in any workspace.
  2. Confirm that compozy__config_get is present in the hosted MCP projection.
  3. Call it for an allowed path that is absent in that workspace, for example a declared Loop input without a configured default.
  4. Inspect the MCP tool result delivered to the provider.

Actual behavior

The tool is discovered and invoked successfully, but the provider receives an MCP error equivalent to:

config_path_not_found: tool not found

The structured transport envelope likewise combines code: tool_not_found, reason_codes: [config_path_not_found], and message: tool not found.

Expected behavior

The public message must agree with the deterministic reason. An absent configuration path should produce provider-visible text equivalent to:

config_path_not_found: config path not found

The existing ToolID, error code, reason code, HTTP/UDS schema, and MCP shape should remain unchanged.

Root cause

The public tool-error serializer derives its safe message only from the broad tool_not_found code. It discards the more specific config_path_not_found reason when choosing the message. The hosted MCP proxy then correctly prefixes the reason to that incorrect generic message.

Impact

Any managed agent that branches on the provider-visible result can take the wrong recovery path. Extension-published agents are affected in the same way as authored or packaged agents; this is not specific to one extension or workflow.

Proposed fix

  • Select the safe public message from the deterministic reason when a reason-specific public message exists, falling back to the existing error-code message otherwise.
  • Map config_path_not_found to config path not found.
  • Add regression coverage at the public HTTP/UDS serialization boundary, the hosted MCP projection boundary, and a managed extension-agent session.
  • Assert that the missing-path result never contains tool not found.

Discovery evidence

In a disposable workspace, a managed extension-published agent discovered and invoked compozy__config_get. The call returned config_path_not_found: tool not found; the agent then abandoned its configuration recovery flow. This is secondary evidence only—the reproduction and fix apply to every managed session.

Out of scope

No new error code or reason code, no ToolID or schema change, no extension-specific fallback, and no prompt-only workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions