Skip to main content
Glama
torshepherd

Compiler Explorer MCP

by torshepherd

list_languages

Retrieve available programming languages from Compiler Explorer to identify supported options for code compilation and analysis.

Instructions

Get a list of supported programming languages.

Returns:
    List of dictionaries containing language information, each with keys:
    - id: Unique identifier for the language
    - name: Display name of the language
    - extensions: List of file extensions associated with the language

Raises:
    HTTPException: If the API request fails

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'list_languages' that delegates to the CompilerExplorerClient instance.
    @mcp.tool()
    async def list_languages() -> list[dict[str, str]]:
        """Get a list of supported programming languages.
    
        Returns:
            List of dictionaries containing language information, each with keys:
            - id: Unique identifier for the language
            - name: Display name of the language
            - extensions: List of file extensions associated with the language
    
        Raises:
            HTTPException: If the API request fails
        """
        try:
            return await ce_client.list_languages()
        except CompilerExplorerError as e:
            raise HTTPException(status_code=e.status_code, detail=str(e))
  • Core helper function in CompilerExplorerClient that fetches the list of languages from the Compiler Explorer API.
    async def list_languages(self) -> list[dict[str, str]]:
        """Get list of supported programming languages.
    
        Returns:
            List of dictionaries containing language information, each with keys:
            - id: Unique identifier for the language
            - name: Display name of the language
            - extensions: List of file extensions associated with the language
    
        Raises:
            CompilerExplorerError: If the API request fails
        """
        return await self._make_request("GET", f"{self.base_url}/languages")
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It adds value by describing the return format (list of dictionaries with specific keys) and error handling (raises HTTPException), which goes beyond the basic purpose. However, it doesn't cover aspects like rate limits, authentication needs, or performance characteristics, leaving some behavioral gaps.

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 with the core purpose, followed by clear sections for returns and raises. Every sentence adds value: the first states the action, the second details the output format, and the third covers error handling. There is no wasted text, making it highly concise.

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 simplicity (0 parameters, no output schema, no annotations), the description is reasonably complete. It explains what the tool does, the return format, and potential errors. However, it lacks usage guidelines and doesn't fully compensate for the absence of annotations by detailing all behavioral aspects, such as side effects or constraints, preventing a perfect score.

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?

The tool has 0 parameters, and the schema description coverage is 100% (as there are no parameters to describe). The description doesn't need to add parameter information, so it appropriately focuses on output and errors. A baseline of 4 is applied since no parameters exist, and the description doesn't attempt to explain non-existent inputs.

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 with 'Get a list of supported programming languages', which is a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'list_compilers_for_language' or 'list_compiler_versions', which might also involve listing operations. This keeps it from a perfect 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 contextual scenarios, such as using it before compilation or for language selection. This lack of explicit when-to-use or when-not-to-use information results in a low score.

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/torshepherd/compiler-explorer-mcp'

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