Skip to main content
Glama
uright

Azure DevOps Wiki MCP Server

by uright

wiki_get_page

Retrieve content from Azure DevOps wiki pages to access documentation, project notes, or team knowledge directly within AI workflows.

Instructions

Get content of a specific wiki page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
organizationNoAzure DevOps organization name
projectNoProject name
wikiIdYesWiki identifier
pathYesPage path or page ID

Implementation Reference

  • Handler function in the MCP server that processes 'wiki_get_page' tool calls: validates input using Zod schema, initializes Azure client if needed, delegates to client.getPage(), and formats response as MCP content.
    private async handleGetPage(args: any) {
      const request = WikiGetPageRequestSchema.parse(args);
      const organization = request.organization || this.config.defaultOrganization;
      const project = request.project || this.config.defaultProject;
      
      if (!organization) {
        throw new Error('Organization is required either as parameter or in server configuration');
      }
      if (!project) {
        throw new Error('Project is required either as parameter or in server configuration');
      }
      
      const client = await this.getClient(organization, project);
      const page = await client.getPage(request);
      
      return {
        content: [{
          type: 'text',
          text: JSON.stringify(page, null, 2)
        }]
      };
    }
  • Core helper method that performs the actual API call to Azure DevOps Wiki API to retrieve page content, handles response parsing, and maps to WikiPageContent type.
    async getPage(request: WikiGetPageRequest): Promise<WikiPageContent> {
      if (!this.wikiApi || !this.connection) {
        throw new Error('Azure DevOps client not initialized');
      }
    
      try {
        const organization = request.organization || this.config.organization;
        const project = request.project || this.config.project;
        
        if (!organization || !project) {
          throw new Error('Organization and project must be provided');
        }
    
        const orgUrl = this.config.azureDevOpsUrl || `https://dev.azure.com/${organization}`;
        const encodedPath = encodeURIComponent(request.path);
        const apiUrl = `${orgUrl}/${project}/_apis/wiki/wikis/${request.wikiId}/pages?path=${encodedPath}&includeContent=true&api-version=7.1`;
    
        const response = await this.connection.rest.client.get(apiUrl);
        
        if (!response.message || response.message.statusCode !== 200) {
          throw new Error(`Failed to get page: HTTP ${response.message?.statusCode || 'Unknown'}`);
        }
    
        const responseBody = await response.readBody();
        if (!responseBody) {
          throw new Error('Empty response body');
        }
    
        const data = JSON.parse(responseBody);
        
        // Handle the response structure
        let pageData;
        if (data.value) {
          // If value is an array, get the first element
          if (Array.isArray(data.value) && data.value.length > 0) {
            pageData = data.value[0];
          } else if (Array.isArray(data.value) && data.value.length === 0) {
            // Empty array means page not found
            throw new Error(`Page not found: ${request.path}`);
          } else {
            // value is not an array, use it directly
            pageData = data.value;
          }
        } else {
          // No value property, use data directly
          pageData = data;
        }
        
        if (!pageData || pageData === null) {
          throw new Error(`Page not found: ${request.path}`);
        }
    
        return {
          id: pageData.id?.toString() || '',
          path: pageData.path || request.path,
          title: pageData.path ? pageData.path.split('/').pop() || '' : '',
          content: pageData.content || '',
          gitItemPath: pageData.gitItemPath || '',
          order: pageData.order || 0,
          version: pageData.version || '',
          isParentPage: pageData.isParentPage || false
        };
      } catch (error) {
        throw new Error(`Failed to get page: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • src/server.ts:82-107 (registration)
    Tool registration in the MCP server's listTools response, defining name 'wiki_get_page', description, and JSON inputSchema.
    {
      name: 'wiki_get_page',
      description: 'Get content of a specific wiki page',
      inputSchema: {
        type: 'object',
        properties: {
          organization: {
            type: 'string',
            description: 'Azure DevOps organization name'
          },
          project: {
            type: 'string',
            description: 'Project name'
          },
          wikiId: {
            type: 'string',
            description: 'Wiki identifier'
          },
          path: {
            type: 'string',
            description: 'Page path or page ID'
          }
        },
        required: ['wikiId', 'path']
      }
    },
  • Zod schema for input validation of wiki_get_page tool requests, used in handleGetPage for parsing arguments.
    export const WikiGetPageRequestSchema = z.object({
      organization: z.string().min(1).optional(),
      project: z.string().min(1).optional(),
      wikiId: z.string().min(1),
      path: z.string().min(1),
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool 'Get[s] content' but doesn't mention whether this requires authentication, what format the content returns in (e.g., HTML, markdown), if there are rate limits, or if it's a read-only operation. The description is minimal and lacks critical behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with a single sentence that directly states the tool's purpose. There's no wasted language or unnecessary elaboration, making it efficient and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is insufficiently complete. It doesn't explain what 'content' means (e.g., raw text, formatted output), how errors are handled, or any prerequisites for using the tool. For a tool with 4 parameters and no structured output documentation, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with all parameters clearly documented in the input schema. The description adds no additional parameter information beyond what's already in the schema, so it meets the baseline score of 3 where the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get content') and resource ('specific wiki page'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its sibling 'wiki_get_page_tree' (which presumably retrieves page structure rather than content), leaving some ambiguity about the exact scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'list_wiki' (for listing pages) or 'search_wiki' (for searching content). It mentions retrieving content for a 'specific' page but doesn't clarify what makes a page 'specific' or when other tools might be more appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/uright/azure-devops-wiki-mcp'

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