Repository navigation
Description
Problem
openapi.Build never applies the OpenAPI parameter-identity rule (pkgs/mcpx/internal/openapi/openapi.go, main c04a943, sha256 79b465b9). Per the spec, a parameter is unique by (name, location), and a parameter declared at path-item level can be overridden at operation level — the operation declaration replaces the shared one, it does not add a second parameter. The code concatenates both lists and treats every entry as distinct, with two observable consequences.
Shape A — an overridden required parameter is duplicated in required: the advertised schema is invalid JSON Schema
Build(:312):params := append(append([]Parameter{}, item.Parameters...), op.Parameters...)— no (name,in) dedup anywhere.buildSchemakeyspropertiesby name only (:491), so the property entry coincidentally ends up the operation's (matching override semantics), but it appends the name torequiredonce per occurrence (:492-494).- Example: path item
/pets/{id}declares{name: id, in: path, required: true}and the GET operation redeclares it (the standard override, e.g. to refine its description). The generated tool'sinputSchemais{"type":"object","properties":{"id":…},"required":["id","id"]}. - JSON Schema requires the elements of
requiredto be unique. The schema mcpx advertises for the tool (viamcpx api toolsand the MCP server surface,internal/cli/openapi_tools.go) is therefore invalid for any spec using this spec-sanctioned pattern, and strict MCP clients/validators may refuse the tool outright.
Shape B — same name in two locations: two distinct parameters conflated by the name-keyed schema
- A query parameter
keyand a header parameterkeyare distinct parameters per the spec (uniqueness is name+location), and both may legitimately apply to one operation (one at path level, one at operation level, or both at operation level). - The flattened schema can only show one of them:
propertiesis keyed by name (:491), so the later entry's type/description/location note silently replaces the earlier one's — one parameter is invisible to the caller. Call(:565-586) nevertheless iterates both entries inTool.Paramsand routes each by its ownin, sending the singleargs["key"]value in both locations. The wire behaviour and the advertised schema describe different operations.
Evidence
- Line trace on main c04a943 (file sha256
79b465b9636fa1e51025824ff395e27bf28d0849fcb0c4bd7a2490a097b7cde5): concatenation at :312 with no dedup;props[p.Name] = entry:491;required = append(required, p.Name):492-494 with no uniqueness check;Callrouting loop :565-586 (path:572,header:576-577, default→query :585) iterates every entry inspec.Params.openapi_test.gohas no path-item-vs-operation parameter case. - Premise exercised this run with a faithful mirror of the three code paths (goal
hidden_files/probe-2026-10-28-laneB-openapi-paramoverride/premise.py+premise.log): shape A →required == ["id","id"]; shape B → schema advertises only the header entry while the mirrored Call sends the value in both query and header.
Disclosure: the prepared Go probe (hidden_files/probe-2026-10-28-laneB-openapi-paramoverride/probe_laneb_test.go, package openapi_test; asserts a duplicate-free required for the override spec and pins shape B's schema/wire conflation against an httptest server) was not executed — the laptop was unreachable this run (SSH tunnel closes immediately) and probes are never compiled on the sandbox. Triage should run the probe first and correct this issue if any verdict differs.
Why it matters
Path-level parameters with operation-level overrides are a normal, spec-endorsed way to write OpenAPI documents (shared path/header parameters refined per operation). For those documents mcpx currently publishes an invalid tool schema, and for same-name cross-location parameters it publishes a schema that does not describe what the call actually sends.
Acceptance criteria
- Triage runs the prepared probe and confirms/corrects both verdicts.
- Parameter resolution follows the spec: an operation-level parameter with the same (name,
in) as a path-level one replaces it exactly once inTool.Paramsand in the schema. - Generated
inputSchemanever contains a duplicatedrequiredentry, for any spec; a regression test pins the override pattern. - Shape B gets a stated ruling (e.g. schema disambiguation, a Build-time error naming the collision, or documented conflation with matching Call behaviour) pinned by a test — the schema and the wire must not silently disagree.
- Existing
internal/openapitests pass; specs without path-level parameters are unchanged.
Distinct from #1668 (same package, different defect: map-iteration nondeterminism in name disambiguation and the media pick; this issue is deterministic and concerns parameter identity).
Activity
dezren39 commentedon Oct 28, 2026
🤖 Agent note · filed
required, producing an invalid inputSchema; same-name parameters in two locations are conflated by the name-keyed schema while Call sends both); first step is running the prepared Go probe in the real package on the laptop.requiredentry, shape B has a stated ruling pinned by a test, and existing openapi tests stay green.dezren39 commentedon Oct 28, 2026
Intake review
Buildstill concatenates path-level and operation-level parameters with no (name,in) dedup.openapi.Build), and the wider mcpx(openapi) cluster filed this morning (mcpx(artifacts): a content-addressed blob can change after registration — PutFile and Export hardlink it to files outside the store, and adopt() then cements the mutated bytes under the original hash #1660, mcpx(mcpauth): literal credentials containing $ are silently rewritten by expansion — $2 and $$ are eaten, $HOME is spliced in, and the phantom name refuses the server as 'not set' #1662–mcpx(mcpheaders): the numeric header comparison only forgives the float form in the header — a body written 42.0 or 4.2e1 is rejected as 'not an integer' before the comparison runs #1665).kind/bug,source/creator,priority/normal,effort/s,app/mcpx,queue/queued). Markedmeta/enrichedonly.requiredentry makes the advertised tool schema invalid JSON Schema — strict MCP clients may reject the tool outright, not merely mis-display it. Same-name parameters in different locations (query vs header) must NOT be merged by a naive name-only dedup.in) pair with operation-level entries winning, applied beforebuildSchema; regression tests for both shapes in the issue (override of a required path parameter; same name in two locations kept distinct).— fleet monitor intake pass, 2026-10-28T13:45Z
14 remaining items
dezren39 commentedon Oct 31, 2026
🤖 Agent note · picked up
Merge pull request #3053 from developing-today/queue/4228-1669-openap…
dezren39 commentedon Oct 31, 2026
🤖 Agent note · done