Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions gitnexus/src/mcp/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ export interface ToolDefinition {
}
>;
required: string[];
/**
* JSON-Schema `anyOf` for cross-property constraints `required` cannot express
* — e.g. "at least one of route/file". Forwarded verbatim to clients by the
* server's ListTools handler, so MCP clients see the constraint.
*/
anyOf?: Array<{ required: string[] }>;
};
}

Expand Down Expand Up @@ -796,9 +790,6 @@ Response shape is keyed on how many routes match, not on the data: exactly one m
repo: { type: 'string', description: 'Repository name or path.' },
},
required: [],
// Exactly one lookup key is needed, but either works (route wins if both
// are passed) — so the structural constraint is "at least one of route/file".
anyOf: [{ required: ['route'] }, { required: ['file'] }],
},
},
{
Expand Down
13 changes: 7 additions & 6 deletions gitnexus/test/unit/tools.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,15 @@ describe('GITNEXUS_TOOLS', () => {
expect(contextTool.inputSchema.properties.file).toMatchObject({ type: 'string' });
});

it('api_impact tool expresses the route-or-file requirement via anyOf (#2308)', () => {
it('api_impact tool avoids top-level schema combinators for Bedrock compatibility (#2487)', () => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MEDIUM — the one blocking item] This file conflicts with current main: since your branch point (a05b501), main added adjacent tests in this exact region — context tool advertises file as a compatibility alias right above, and impact tool requires direction … without combinators right below (from 3f3494f/a75844b6) — while this PR rewrites the api_impact test in between, so the merge is positional-conflicted.

Resolution is mechanical: rebase onto main, keep both of main's neighboring tests unchanged, and take this PR's rewritten api_impact test in place of the old anyOf one. Your interface-field removal in tools.ts auto-merges cleanly (verified with git merge-tree), and post-merge nothing else reads or writes inputSchema.anyOf.

For the record, the red tests / windows-latest 1/3 shard is lbug-multiwriter-deadlock.test.ts — unrelated to this change; the rebase push will re-run CI.

const apiImpactTool = GITNEXUS_TOOLS.find((t) => t.name === 'api_impact')!;
expect(apiImpactTool.inputSchema.anyOf).toEqual([
{ required: ['route'] },
{ required: ['file'] },
]);
// route/file stay optional in `required` (anyOf carries the cross-field rule)
expect(apiImpactTool.inputSchema).not.toHaveProperty('anyOf');
expect(apiImpactTool.inputSchema).not.toHaveProperty('oneOf');
expect(apiImpactTool.inputSchema).not.toHaveProperty('allOf');
// route/file stay optional in the transport schema; callTool keeps the
// runtime guard so providers that reject top-level combinators can load it.
expect(apiImpactTool.inputSchema.required).toEqual([]);
expect(apiImpactTool.description).toContain('Requires at least "route" or "file"');
});

it('impact tool requires direction and advertises target, name, or symbol without combinators', () => {
Expand Down
Loading