list_regions
Retrieve a list of all available Linode cloud regions to determine where you can deploy cloud resources.
Instructions
List all available Linode regions
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The handler function that implements the list_regions tool. It retrieves all Linode regions using the API client, formats them into a list of dictionaries, and returns as JSON string. Handles errors gracefully.def list_regions() -> str: """List all available Linode regions""" try: # Get the regions list regions_list = linode_client.regions() # Process each region in the collection result = [] # Type annotation to help linter for item in regions_list: # Cast to Region type to resolve linting issues region = cast(Region, item) result.append({ "id": region.id, "country": region.country, "status": region.status, "capabilities": region.capabilities }) return json.dumps(result) except Exception as e: logger.error(f"Error listing regions: {str(e)}") return json.dumps({"error": str(e)})
- src/linode_mcp/tools/linode_tools.py:21-21 (registration)The MCP decorator @mcp_server.tool() that registers the list_regions function as a tool with the server.@mcp_server.tool()
- src/linode_mcp/server.py:55-55 (registration)The call to register_tools which executes the tool registrations including list_regions.register_tools(mcp, linode_client)