list_files
Browse repository contents by listing files and directories at a specified path within Azure DevOps projects to manage codebase structure.
Instructions
Lists files in a repository at a specified path.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The path to list files from. | |
| project | Yes | The name or ID of the project. | |
| repository_id | Yes | The name or ID of the repository. |
Implementation Reference
- The core handler function for the 'list_files' tool. It uses the Azure DevOps Git client to retrieve items (files and directories) recursively from the specified path in the repository.def list_files(self, project, repository_id, path): return self.git_client.get_items( project=project, repository_id=repository_id, scope_path=path, recursion_level='full' )
- mcp_azure_devops/server.py:475-497 (registration)Registers the 'list_files' tool with the MCP server using types.Tool, defining its name, description, and input schema.types.Tool( name="list_files", description="Lists files in a repository at a specified path.", 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 list files from." }, }, "required": ["project", "repository_id", "path"], "additionalProperties": False } ),
- mcp_azure_devops/server.py:478-496 (schema)Input schema definition for the 'list_files' tool, specifying required parameters and their types/descriptions.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 list files from." }, }, "required": ["project", "repository_id", "path"], "additionalProperties": False }
- mcp_azure_devops/server.py:1051-1052 (helper)Dispatch logic in the server's tool execution method that calls the client.list_files handler with unpacked arguments.elif name == "list_files": return self.client.list_files(**arguments)