Skip to main content
Glama

update_wiki_page_safe

Update Azure DevOps wiki pages with automatic retry on version conflicts to prevent data loss during concurrent edits.

Instructions

Safely updates a wiki page with automatic retry on version conflicts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesThe content of the wiki page.
max_retriesNoMaximum number of retry attempts (default: 3).
pathYesThe path of the wiki page.
projectYesThe name or ID of the project.
wiki_identifierYesThe name or ID of the wiki.

Implementation Reference

  • The main handler function that implements the safe update of a wiki page, including retry logic for version conflicts using ETag.
    def update_wiki_page_safe(self, project, wiki_identifier, path, content, max_retries=3): """ Safely updates a wiki page with automatic retry on version conflicts. """ for attempt in range(max_retries): try: # Get the latest version of the page 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 ) except Exception as e: if "version" in str(e).lower() and attempt < max_retries - 1: # Version conflict, retry with fresh version continue else: raise e raise Exception(f"Failed to update wiki page after {max_retries} attempts due to version conflicts")
  • The tool schema definition including input parameters validation and description for the MCP protocol.
    types.Tool( name="update_wiki_page_safe", description="Safely updates a wiki page with automatic retry on version conflicts.", 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." }, "max_retries": { "type": "integer", "description": "Maximum number of retry attempts (default: 3)." }, }, "required": ["project", "wiki_identifier", "path", "content"], "additionalProperties": False } ),
  • The server-side dispatch and registration point where the tool call is routed to the client implementation and response is formatted.
    elif name == "update_wiki_page_safe": page = self.client.update_wiki_page_safe(**arguments) return { "path": page.page.path, "url": page.page.url, "content": page.page.content, "message": "Wiki page updated successfully with safe retry mechanism." }

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