Skip to content

Commit d70ab9d

Browse files
authored
fix tool parameter names for strict claude code naming conventions (#319)
Replaces $top and $skip with top and skip not to break some clients ## GitHub issue number [317](#317) ## **Associated Risks** N/A ## ✅ **PR Checklist** - [X] **I have read the [contribution guidelines](https://github.com/microsoft/azure-devops-mcp/blob/main/CONTRIBUTING.md)** - [X] **I have read the [code of conduct guidelines](https://github.com/microsoft/azure-devops-mcp/blob/main/CODE_OF_CONDUCT.md)** - [X] Title of the pull request is clear and informative. - [X] 👌 Code hygiene - [N/A] 🔭 Telemetry added, updated, or N/A - [N/A] 📄 Documentation added, updated, or N/A - [N/A] 🛡️ Automated tests added, or N/A ## 🧪 **How did you test it?** successfully made calls to the search MCP in Claude code, Copilot, Cline and Roo
1 parent 472a22f commit d70ab9d

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/tools/search.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@ function configureSearchTools(server: McpServer, tokenProvider: () => Promise<Ac
2828
path: z.array(z.string()).optional().describe("Filter by paths"),
2929
branch: z.array(z.string()).optional().describe("Filter by branches"),
3030
includeFacets: z.boolean().default(false).describe("Include facets in the search results"),
31-
$skip: z.number().default(0).describe("Number of results to skip"),
32-
$top: z.number().default(5).describe("Maximum number of results to return"),
31+
skip: z.number().default(0).describe("Number of results to skip"),
32+
top: z.number().default(5).describe("Maximum number of results to return"),
3333
},
34-
async ({ searchText, project, repository, path, branch, includeFacets, $skip, $top }) => {
34+
async ({ searchText, project, repository, path, branch, includeFacets, skip, top }) => {
3535
const accessToken = await tokenProvider();
3636
const connection = await connectionProvider();
3737
const url = `https://almsearch.dev.azure.com/${orgName}/_apis/search/codesearchresults?api-version=${apiVersion}`;
3838

3939
const requestBody: Record<string, unknown> = {
4040
searchText,
4141
includeFacets,
42-
$skip,
43-
$top,
42+
$skip: skip,
43+
$top: top,
4444
};
4545

4646
const filters: Record<string, string[]> = {};
@@ -87,18 +87,18 @@ function configureSearchTools(server: McpServer, tokenProvider: () => Promise<Ac
8787
project: z.array(z.string()).optional().describe("Filter by projects"),
8888
wiki: z.array(z.string()).optional().describe("Filter by wiki names"),
8989
includeFacets: z.boolean().default(false).describe("Include facets in the search results"),
90-
$skip: z.number().default(0).describe("Number of results to skip"),
91-
$top: z.number().default(10).describe("Maximum number of results to return"),
90+
skip: z.number().default(0).describe("Number of results to skip"),
91+
top: z.number().default(10).describe("Maximum number of results to return"),
9292
},
93-
async ({ searchText, project, wiki, includeFacets, $skip, $top }) => {
93+
async ({ searchText, project, wiki, includeFacets, skip, top }) => {
9494
const accessToken = await tokenProvider();
9595
const url = `https://almsearch.dev.azure.com/${orgName}/_apis/search/wikisearchresults?api-version=${apiVersion}`;
9696

9797
const requestBody: Record<string, unknown> = {
9898
searchText,
9999
includeFacets,
100-
$skip,
101-
$top,
100+
$skip: skip,
101+
$top: top,
102102
};
103103

104104
const filters: Record<string, string[]> = {};
@@ -141,18 +141,18 @@ function configureSearchTools(server: McpServer, tokenProvider: () => Promise<Ac
141141
state: z.array(z.string()).optional().describe("Filter by work item states"),
142142
assignedTo: z.array(z.string()).optional().describe("Filter by assigned to users"),
143143
includeFacets: z.boolean().default(false).describe("Include facets in the search results"),
144-
$skip: z.number().default(0).describe("Number of results to skip for pagination"),
145-
$top: z.number().default(10).describe("Number of results to return"),
144+
skip: z.number().default(0).describe("Number of results to skip for pagination"),
145+
top: z.number().default(10).describe("Number of results to return"),
146146
},
147-
async ({ searchText, project, areaPath, workItemType, state, assignedTo, includeFacets, $skip, $top }) => {
147+
async ({ searchText, project, areaPath, workItemType, state, assignedTo, includeFacets, skip, top }) => {
148148
const accessToken = await tokenProvider();
149149
const url = `https://almsearch.dev.azure.com/${orgName}/_apis/search/workitemsearchresults?api-version=${apiVersion}`;
150150

151151
const requestBody: Record<string, unknown> = {
152152
searchText,
153153
includeFacets,
154-
$skip,
155-
$top,
154+
$skip: skip,
155+
$top: top,
156156
};
157157

158158
const filters: Record<string, unknown> = {};

0 commit comments

Comments
 (0)