Skip to main content
Glama
uright

Azure DevOps Wiki MCP Server

by uright

wiki_get_page

Access the content of an Azure DevOps wiki page using its ID and path.

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

  • The actual implementation of the getPage function that fetches wiki page content from the Azure DevOps REST API. It takes a WikiGetPageRequest, calls the Azure DevOps Wiki Pages API with the path and includeContent=true, parses the response, and returns a WikiPageContent object.
    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)}`);
      }
    }
  • The handleGetPage method in the server class that parses the request args using WikiGetPageRequestSchema, gets the client, calls client.getPage(request), and returns the result as JSON.
    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)
        }]
      };
    }
  • The Zod schema WikiGetPageRequestSchema defining validation for the input: organization (optional), project (optional), wikiId (required), path (required).
    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),
    });
  • The WikiPageContent interface defining the output type for the getPage operation: id, path, title, content, gitItemPath, order, version, isParentPage.
    export interface WikiPageContent {
      id: string;
      path: string;
      title: string;
      content: string;
      gitItemPath: string;
      order: number;
      version: string;
      isParentPage: boolean;
    }
  • src/server.ts:82-170 (registration)
    Registration of the 'wiki_get_page' tool in the ListToolsRequestSchema handler with its name, description, and input schema (organization, project, wikiId, path). Also dispatched in the CallToolRequestSchema switch statement at line 169.
          {
            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']
            }
          },
          {
            name: 'wiki_update_page',
            description: 'Update content of an existing wiki page or create a new page if it does not exist',
            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'
                },
                content: {
                  type: 'string',
                  description: 'New page content (Markdown)'
                }
              },
              required: ['wikiId', 'path', 'content']
            }
          },
          {
            name: 'list_wiki',
            description: 'List all wikis in a project',
            inputSchema: {
              type: 'object',
              properties: {
                organization: {
                  type: 'string',
                  description: 'Azure DevOps organization name'
                },
                project: {
                  type: 'string',
                  description: 'Project name'
                }
              },
              required: []
            }
          }
        ] as Tool[]
      };
    });
    
    this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
    
      try {
        switch (name) {
          case 'search_wiki':
            return await this.handleSearchWiki(args);
          case 'wiki_get_page_tree':
            return await this.handleGetPageTree(args);
          case 'wiki_get_page':
            return await this.handleGetPage(args);
Behavior2/5

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

With no annotations, the description must disclose behavioral traits. It only states 'get content' but omits read-only nature, authentication needs, error handling (e.g., page not found), or rate limits. This is insufficient transparency.

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

Conciseness4/5

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

The description is a single concise sentence. It front-loads the action and resource. However, it could be slightly more informative without sacrificing brevity.

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 tool has 4 parameters, no output schema, and no annotations, the description is too minimal. It does not explain the return format, error conditions, or any behavior beyond the basic action.

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?

Schema description coverage is 100%, so parameters are well-documented in the schema. The description adds no extra meaning beyond that. Baseline score of 3 is appropriate.

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

Purpose5/5

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

The description clearly states the tool's action ('Get content') and resource ('a specific wiki page'). It distinguishes itself from sibling tools like list_wiki, search_wiki, get_page_tree, and update_page by focusing on retrieving a single page's content.

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 search_wiki or list_wiki. It lacks any prerequisites, context for selection, or exclusion criteria.

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