get_wiki_page_suggestions
Generate autocomplete suggestions for wiki pages in Azure DevOps projects based on partial input to help users quickly find and navigate to relevant documentation.
Instructions
Get page suggestions based on partial input - useful for autocomplete-like functionality.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| partial_input | Yes | Partial page path or title to get suggestions for. | |
| project | Yes | The name or ID of the project. | |
| wiki_identifier | Yes | The name or ID of the wiki. |
Implementation Reference
- The core handler function that implements the get_wiki_page_suggestions tool logic by fetching all wiki pages, scoring them based on how well they match the partial_input (prefix, contains, or part match), sorting by score descending, and returning the top 10 suggestions.def get_wiki_page_suggestions(self, project, wiki_identifier, partial_input): """ Get page suggestions based on partial input. """ pages = self.list_wiki_pages(project, wiki_identifier) suggestions = [] for page in pages: path_lower = page["path"].lower() input_lower = partial_input.lower() # Score based on how well the input matches score = 0 if path_lower.startswith(input_lower): score = 100 # Exact prefix match elif input_lower in path_lower: score = 50 # Contains match elif any(part.startswith(input_lower) for part in path_lower.split("/")): score = 25 # Part starts with input if score > 0: suggestions.append({ **page, "match_score": score }) # Sort by score and return top suggestions suggestions.sort(key=lambda x: x["match_score"], reverse=True) return suggestions[:10]
- mcp_azure_devops/server.py:763-785 (schema)The MCP tool schema definition, including input schema with required parameters: project, wiki_identifier, partial_input, and description.types.Tool( name="get_wiki_page_suggestions", description="Get page suggestions based on partial input - useful for autocomplete-like functionality.", inputSchema={ "type": "object", "properties": { "project": { "type": "string", "description": "The name or ID of the project." }, "wiki_identifier": { "type": "string", "description": "The name or ID of the wiki." }, "partial_input": { "type": "string", "description": "Partial page path or title to get suggestions for." }, }, "required": ["project", "wiki_identifier", "partial_input"], "additionalProperties": False } ),
- mcp_azure_devops/server.py:1041-1042 (registration)The dispatch logic in the _execute_tool method that registers and routes calls to the get_wiki_page_suggestions handler in the AzureDevOpsClient.elif name == "get_wiki_page_suggestions": return self.client.get_wiki_page_suggestions(**arguments)