Skip to main content
Glama
lemenkov
by lemenkov

get_file

Retrieve file content from Pagure repositories by specifying project, filename, branch, and namespace parameters to access specific files.

Instructions

Get file content from a Pagure repository.

Args: project: Project name filename: File path (e.g., 'python3.spec', 'sources') branch: Branch name (default: rawhide) namespace: Project namespace (default: rpms)

Returns: File content as string

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectYes
filenameYes
branchNorawhide
namespaceNorpms

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool registration and handler function for get_file.
    @mcp.tool()
    async def get_file(
        project: str,
        filename: str,
        branch: str = "rawhide",
        namespace: str = "rpms",
    ) -> str:
        """Get file content from a Pagure repository.
    
        Args:
            project: Project name
            filename: File path (e.g., 'python3.spec', 'sources')
            branch: Branch name (default: rawhide)
            namespace: Project namespace (default: rpms)
    
        Returns:
            File content as string
        """
        client = get_client()
        content = await client.get_file(project, filename, branch, namespace)
    
        return content
  • The actual implementation of the get_file logic that performs the HTTP request to the Pagure API.
    async def get_file(
        self,
        project: str,
        filename: str,
        branch: str = "rawhide",
        namespace: str = "rpms",
    ) -> str:
        """Get file content from repository.
    
        Args:
            project: Project name
            filename: File path
            branch: Branch name
            namespace: Project namespace
    
        Returns:
            File content as string
        """
        response = await self.client.get(
            f"{self.base_url}/{namespace}/{project}/raw/{branch}/f/{filename}",
            headers=self._get_headers(),
        )
        response.raise_for_status()
        return response.text
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves file content but doesn't mention potential issues like authentication requirements, rate limits, error handling, or whether it's a read-only operation. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded, starting with the core purpose, followed by parameter details and return information. Every sentence earns its place, with no redundant or verbose language, making it efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (4 parameters, 2 required) and the presence of an output schema (which covers return values), the description is fairly complete. It explains the purpose and parameters adequately. However, the lack of behavioral details (e.g., error cases, permissions) and usage guidelines slightly reduces completeness, though the output schema mitigates some of this.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description compensates by explaining all four parameters in the 'Args' section, including defaults for 'branch' and 'namespace'. It adds meaning beyond the bare schema by specifying example values (e.g., 'python3.spec') and clarifying the purpose of each parameter, which is valuable given the low schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get file content from a Pagure repository.' It specifies the verb ('Get'), resource ('file content'), and context ('Pagure repository'), which is clear and specific. However, it doesn't explicitly differentiate from sibling tools like 'get_commit' or 'get_project_info', which prevents a score of 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools or contexts where other tools might be more appropriate, such as using 'get_commit' for commit details or 'get_project_info' for project metadata. This lack of comparative guidance limits its utility for an AI agent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/lemenkov/mcp-pagure'

If you have feedback or need assistance with the MCP directory API, please join our Discord server