Skip to main content
Glama

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
NameRequiredDescriptionDefault
pathYesThe path to list files from.
projectYesThe name or ID of the project.
repository_idYesThe 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' )
  • 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 } ),
  • 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 }
  • 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)

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