search_wiki_pages
Find Azure DevOps wiki pages by searching titles and content with specific terms to locate project documentation efficiently.
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. | |
| wiki_identifier | Yes | The name or ID of the wiki. | |
| search_term | Yes | The term to search for in page titles and content. |
Implementation Reference
- The primary handler function implementing the search_wiki_pages tool. It lists all wiki pages, fetches content for each, and returns matching pages based on 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:646-668 (registration)The MCP tool registration for search_wiki_pages, including name, description, and input schema definition.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 server that calls the client method for search_wiki_pages.elif name == "search_wiki_pages": return self.client.search_wiki_pages(**arguments)