Skip to main content
Glama

get_wiki_page_tree

Retrieve the hierarchical structure of wiki pages to improve navigation and organization within Azure DevOps projects.

Instructions

Get hierarchical structure of wiki pages for better navigation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectYesThe name or ID of the project.
wiki_identifierYesThe name or ID of the wiki.

Implementation Reference

  • The core handler function that lists all wiki pages and constructs a hierarchical tree structure by parsing page paths into nested dictionaries.
    def get_wiki_page_tree(self, project, wiki_identifier): """ Get hierarchical structure of wiki pages. """ pages = self.list_wiki_pages(project, wiki_identifier) # Organize pages into a tree structure tree = {} for page in pages: path_parts = page["path"].strip("/").split("/") current_level = tree for i, part in enumerate(path_parts): if part not in current_level: current_level[part] = { "children": {}, "info": None } if i == len(path_parts) - 1: # This is the final part, store page info current_level[part]["info"] = page current_level = current_level[part]["children"] return tree
  • Input schema definition for the get_wiki_page_tree tool, specifying required parameters project and wiki_identifier.
    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." }, }, "required": ["project", "wiki_identifier"], "additionalProperties": False
  • Registration of the get_wiki_page_tree tool in the MCP server's tools list, including name, description, and schema.
    types.Tool( name="get_wiki_page_tree", description="Get hierarchical structure of wiki pages for better navigation.", 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." }, }, "required": ["project", "wiki_identifier"], "additionalProperties": False } ),
  • Dispatch logic in the server's tool execution handler that routes calls to the client's get_wiki_page_tree method.
    elif name == "get_wiki_page_tree": return self.client.get_wiki_page_tree(**arguments)
  • Supporting helper function used by get_wiki_page_tree to fetch the flat list of wiki pages from the Azure DevOps API.
    def list_wiki_pages(self, project, wiki_identifier): pages_batch_request = WikiPagesBatchRequest( top=100 # Retrieve up to 100 pages ) pages = self.wiki_client.get_pages_batch( project=project, wiki_identifier=wiki_identifier, pages_batch_request=pages_batch_request ) return [ { "path": page.path, "url": getattr(page, 'url', ''), # Handle missing url attribute "view_stats": [ {"date": stat.date.isoformat(), "count": stat.count} for stat in page.view_stats ] if page.view_stats else [] } for page in pages ]

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/xrmghost/mcp-azure-devops'

If you have feedback or need assistance with the MCP directory API, please join our Discord server