create_or_update_wiki_page_smart
Create or update Azure DevOps wiki pages automatically by specifying project, wiki, path, and content parameters to maintain documentation.
Instructions
Creates a new wiki page or updates existing one intelligently.
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 executes the tool logic: intelligently creates or updates a wiki page by first trying a safe update and falling back to creation if the page does not exist (404 error).def create_or_update_wiki_page_smart(self, project, wiki_identifier, path, content): """ Creates a new wiki page or updates existing one intelligently. """ try: # Try to update first return self.update_wiki_page_safe(project, wiki_identifier, path, content) except Exception as e: if "not found" in str(e).lower() or "404" in str(e): # Page doesn't exist, create it return self.create_wiki_page(project, wiki_identifier, path, content) else: raise e
- mcp_azure_devops/server.py:619-645 (registration)Registers the tool in the MCP server's tools list, including its name, description, and input schema.types.Tool( name="create_or_update_wiki_page_smart", description="Creates a new wiki page or updates existing one intelligently.", 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:622-644 (schema)Defines the input schema for validating the tool's parameters: project, wiki_identifier, path, and 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:1011-1018 (helper)Server-side dispatch logic that calls the client handler with arguments and formats the response for MCP protocol.elif name == "create_or_update_wiki_page_smart": page = self.client.create_or_update_wiki_page_smart(**arguments) return { "path": page.page.path, "url": page.page.url, "content": page.page.content, "message": "Wiki page created or updated successfully." }