create_or_update_wiki_page_smart
Create or update Azure DevOps wiki pages by providing project, wiki identifier, path, and content to maintain documentation.
Instructions
Creates a new wiki page or updates existing one intelligently.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | The content of the wiki page. | |
| path | Yes | The path of the wiki page. | |
| project | Yes | The name or ID of the project. | |
| wiki_identifier | Yes | The name or ID of the wiki. |
Implementation Reference
- The core handler function that implements the tool logic: attempts safe update of wiki page, falls back to create if not found.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 (schema)The input schema and Tool definition used for registration and validation.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:1011-1018 (registration)The dispatch logic in the call_tool handler that routes the tool call to the client method and returns formatted response.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." }