search_wiki_pages
Search for wiki pages by title or content within Azure DevOps projects to find relevant documentation and information.
Instructions
Search for wiki pages by title or content.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | The name or ID of the project. | |
| search_term | Yes | The term to search for in page titles and content. | |
| wiki_identifier | Yes | The name or ID of the wiki. |
Implementation Reference
- The core handler function implementing the search_wiki_pages tool. It lists all wiki pages, fetches content for each, and returns matching pages based on the search term in path or content.def search_wiki_pages(self, project, wiki_identifier, search_term): """ Search for wiki pages by title or content. """ pages = self.list_wiki_pages(project, wiki_identifier) matching_pages = [] for page_info in pages: try: # Get page content to search in page = self.wiki_client.get_page( project=project, wiki_identifier=wiki_identifier, path=page_info["path"], include_content=True ) # Search in path (title) and content if (search_term.lower() in page_info["path"].lower() or (page.page.content and search_term.lower() in page.page.content.lower())): matching_pages.append({ "path": page_info["path"], "url": page_info["url"], "content_preview": page.page.content[:200] + "..." if page.page.content and len(page.page.content) > 200 else page.page.content }) except Exception: # Skip pages that can't be accessed continue return matching_pages
- mcp_azure_devops/server.py:649-667 (schema)Input schema definition for the search_wiki_pages tool, specifying parameters: project, wiki_identifier, search_term.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." }, "search_term": { "type": "string", "description": "The term to search for in page titles and content." }, }, "required": ["project", "wiki_identifier", "search_term"], "additionalProperties": False }
- mcp_azure_devops/server.py:646-668 (registration)Registration of the search_wiki_pages tool in the MCP server using types.Tool, including description and input schema.types.Tool( name="search_wiki_pages", description="Search for wiki pages by title or content.", 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." }, "search_term": { "type": "string", "description": "The term to search for in page titles and content." }, }, "required": ["project", "wiki_identifier", "search_term"], "additionalProperties": False } ),
- mcp_azure_devops/server.py:1019-1020 (handler)Dispatch handler in the MCP server's _execute_tool method that calls the client implementation for search_wiki_pages.elif name == "search_wiki_pages": return self.client.search_wiki_pages(**arguments)