Skip to main content
Glama
mmruesch12
by mmruesch12

edit_wiki_page

Update and manage Azure DevOps wiki pages directly by modifying content, specifying project and wiki details, and ensuring concurrency control with ETag.

Instructions

Edit an existing wiki page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesNew content of the wiki page
etagNoETag for concurrency control
pathYesPath of the wiki page
projectYesName of the Azure DevOps project
wikiYesName of the wiki

Implementation Reference

  • Core handler function for the 'edit_wiki_page' tool. Parses input parameters using Zod schema, retrieves current page ETag if not provided, and updates the wiki page content via Azure DevOps REST API calls.
    export async function editWikiPage(rawParams: any) {
      // Parse arguments with defaults from environment variables
      const params = editWikiPageSchema.parse({
        project: rawParams.project || DEFAULT_PROJECT,
        wiki: rawParams.wiki,
        path: rawParams.path,
        content: rawParams.content,
        etag: rawParams.etag,
      });
    
      console.error("[API] Editing wiki page:", params.path);
    
      try {
        // Get current page to get ETag if not provided
        const wikiId = params.wiki; // Assuming wiki parameter is the wiki ID
        const getPageUrl = `${ORG_URL}/${
          params.project
        }/_wiki/wikis/${wikiId}/pages?path=${encodeURIComponent(
          params.path
        )}&api-version=7.1-preview.1`;
    
        const currentPage = await makeAzureDevOpsRequest(getPageUrl);
        console.error("[API] Current page:", currentPage);
    
        // Use provided etag or get from current page
        const etag = params.etag || currentPage.eTag;
        console.error("[API] Using ETag:", etag);
    
        // Then update the page
        const updatePageUrl = `${ORG_URL}/${
          params.project
        }/_wiki/wikis/${wikiId}/pages?path=${encodeURIComponent(
          params.path
        )}&api-version=7.1-preview.1`;
    
        const page = await makeAzureDevOpsRequest(
          updatePageUrl,
          "PUT",
          { content: params.content },
          { "If-Match": etag }
        );
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(page, null, 2),
            },
          ],
        };
      } catch (error) {
        logError("Error editing wiki page", error);
        throw error;
      }
  • Zod schema and TypeScript type for validating and typing the input parameters of the editWikiPage handler.
    export const editWikiPageSchema = z.object({
      project: z.string(),
      wiki: z.string(),
      path: z.string(),
      content: z.string(),
      etag: z.string(),
    });
    
    export type EditWikiPageParams = z.infer<typeof editWikiPageSchema>;
  • Tool registration specification for 'edit_wiki_page' within the wikiTools array, defining name, description, and JSON inputSchema advertised to MCP clients via listTools.
    {
      name: "edit_wiki_page",
      description: "Edit an existing wiki page",
      inputSchema: {
        type: "object",
        properties: {
          project: {
            type: "string",
            description: "Name of the Azure DevOps project",
          },
          wiki: {
            type: "string",
            description: "Name of the wiki",
          },
          path: {
            type: "string",
            description: "Path of the wiki page",
          },
          content: {
            type: "string",
            description: "New content of the wiki page",
          },
          etag: {
            type: "string",
            description: "ETag for concurrency control",
          },
        },
        required: ["project", "wiki", "path", "content"],
      },
    },
  • src/index.ts:93-94 (registration)
    Dispatch handler in the MCP server's CallToolRequest handler that routes calls to 'edit_wiki_page' to the editWikiPage function.
    case "edit_wiki_page":
      return await editWikiPage(request.params.arguments || {});
  • src/index.ts:50-62 (registration)
    MCP server request handler for ListToolsRequest that includes wikiTools (containing edit_wiki_page spec) in the advertised tool list.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          // Work Items
          ...workItemTools,
          // Pull Requests
          ...pullRequestTools,
          // Wiki
          ...wikiTools,
          // Projects
          ...projectTools,
        ],
      };
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool edits a wiki page, implying mutation, but doesn't disclose behavioral traits such as required permissions, concurrency handling (hinted by 'etag' parameter), rate limits, or what happens on failure. This leaves significant gaps for safe agent invocation.

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 a single, efficient sentence with zero waste. It's front-loaded and appropriately sized for its purpose, though it could benefit from additional context. Every word earns its place without redundancy.

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 complexity (mutation tool with 5 parameters, no annotations, no output schema), the description is incomplete. It lacks details on behavioral aspects like error handling, return values, and operational constraints. While the schema covers parameters, the overall context for safe and effective use is insufficient.

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 the schema fully documents all 5 parameters. The description adds no meaning beyond the schema—it doesn't explain parameter interactions (e.g., how 'etag' prevents conflicts) or provide usage examples. Baseline is 3 since the schema handles parameter documentation adequately.

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

Purpose3/5

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

The description 'Edit an existing wiki page' clearly states the action (edit) and resource (wiki page), but it's vague about scope and doesn't differentiate from sibling tools like 'create_wiki_page' or other editing tools. It lacks specificity about what aspects are edited (e.g., content only vs. metadata).

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing page), exclusions (e.g., not for creating new pages), or comparisons to siblings like 'create_wiki_page'. The description implies usage but offers no explicit context.

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

Related 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/mmruesch12/azdo-mcp'

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