get_file_content
Retrieve file content from Azure DevOps repositories to access code, documentation, or configuration files for development workflows.
Instructions
Gets the content of a file in a repository.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | The name or ID of the project. | |
| repository_id | Yes | The name or ID of the repository. | |
| path | Yes | The path to the file. |
Implementation Reference
- The core handler function that implements the logic to retrieve file content from an Azure DevOps repository using the Git client API.def get_file_content(self, project, repository_id, path): return self.git_client.get_item_text( project=project, repository_id=repository_id, path=path )
- mcp_azure_devops/server.py:498-520 (registration)Tool registration in the MCP server, defining the tool name, description, and input schema for validation.types.Tool( name="get_file_content", description="Gets the content of a file in a repository.", inputSchema={ "type": "object", "properties": { "project": { "type": "string", "description": "The name or ID of the project." }, "repository_id": { "type": "string", "description": "The name or ID of the repository." }, "path": { "type": "string", "description": "The path to the file." }, }, "required": ["project", "repository_id", "path"], "additionalProperties": False } ),
- mcp_azure_devops/server.py:1053-1054 (handler)Dispatch handler in the server's _execute_tool method that invokes the AzureDevOpsClient's get_file_content method with parsed arguments.elif name == "get_file_content": return self.client.get_file_content(**arguments)