update_wiki_page
Modify existing wiki pages in Azure DevOps projects by updating content, project details, and page paths to maintain documentation accuracy.
Instructions
Updates an existing wiki page with new 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. | |
| path | Yes | The path of the wiki page. | |
| content | Yes | The content of the wiki page. |
Implementation Reference
- The core handler function that implements the logic for updating a wiki page. It retrieves the current page to get the ETag for optimistic concurrency, then calls the Azure DevOps wiki_client to create or update the page with the new content.def update_wiki_page(self, project, wiki_identifier, path, content): page = self.wiki_client.get_page( project=project, wiki_identifier=wiki_identifier, path=path ) # Try to get ETag from various possible locations etag = None if hasattr(page, 'eTag'): etag = page.eTag elif hasattr(page, 'etag'): etag = page.etag elif hasattr(page, 'e_tag'): etag = page.e_tag elif hasattr(page, '_etag'): etag = page._etag elif hasattr(page, 'page') and hasattr(page.page, 'eTag'): etag = page.page.eTag elif hasattr(page, 'page') and hasattr(page.page, 'etag'): etag = page.page.etag elif hasattr(page, 'page') and hasattr(page.page, 'e_tag'): etag = page.page.e_tag parameters = { "content": content } return self.wiki_client.create_or_update_page( project=project, wiki_identifier=wiki_identifier, path=path, parameters=parameters, version=etag )
- mcp_azure_devops/server.py:357-383 (schema)Defines the tool schema including name, description, and input schema validation for the update_wiki_page tool, which is registered in the MCP server's tool list.types.Tool( name="update_wiki_page", description="Updates an existing wiki page with new 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." }, "path": { "type": "string", "description": "The path of the wiki page." }, "content": { "type": "string", "description": "The content of the wiki page." }, }, "required": ["project", "wiki_identifier", "path", "content"], "additionalProperties": False } ),
- mcp_azure_devops/server.py:967-973 (registration)The registration and dispatch logic in the MCP server's _execute_tool method that handles calls to 'update_wiki_page' by invoking the client method and formatting the response.elif name == "update_wiki_page": page = self.client.update_wiki_page(**arguments) return { "path": page.page.path, "url": page.page.url, "content": page.page.content, }