Skip to main content
Glama

list_languages

Retrieve a list of programming languages supported by the Compiler Explorer API, including unique IDs, display names, and associated file extensions.

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'. This is the primary execution function registered as a tool via @mcp.tool(). It 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 implementation of list_languages in CompilerExplorerClient class. Performs the HTTP GET request to Compiler Explorer API to retrieve the list of languages.
    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")
  • server.py:252-252 (registration)
    Registration of the list_languages tool using the @mcp.tool() decorator on FastMCP instance.
    @mcp.tool()

Other Tools

Related 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