get_public_api_details
Retrieve comprehensive details for any API in the catalog using its unique identifier.
Instructions
Get detailed information about a specific API by its unique public-apis-mcp server ID
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| api | Yes | API display name | |
| api_link | Yes | ||
| description | Yes | ||
| auth | No | ||
| https | No | ||
| cors | No | ||
| category | No |
Implementation Reference
- src/public_apis_mcp/tools.py:34-43 (handler)The tool handler function 'get_public_api_details' that executes the tool logic: takes an API id string, loads the catalog, looks up the item by id, and returns the ApiItem or raises ValueError if not found.
@mcp.tool def get_public_api_details(id: str) -> ApiItem: """Get detailed information about a specific API by its unique public-apis-mcp server ID """ items, by_id = load_catalog_indexed() item = by_id.get(id) if not item: raise ValueError(f"API id not found: {id}") return item - src/public_apis_mcp/types.py:6-15 (schema)The ApiItem Pydantic model used as the return type / output schema for get_public_api_details.
class ApiItem(BaseModel): id: str api: str = Field(description="API display name") api_link: str description: str auth: str | None = None https: str | bool | None = None cors: str | None = None category: str | None = None - src/public_apis_mcp/tools.py:34-43 (registration)The tool is registered via the @mcp.tool decorator on the get_public_api_details function inside register_tools() which receives the FastMCP instance.
@mcp.tool def get_public_api_details(id: str) -> ApiItem: """Get detailed information about a specific API by its unique public-apis-mcp server ID """ items, by_id = load_catalog_indexed() item = by_id.get(id) if not item: raise ValueError(f"API id not found: {id}") return item - The helper function 'load_catalog_indexed' that loads and indexes the catalog, used by the tool to look up an API by id.
def load_catalog_indexed() -> tuple[list[ApiItem], dict[str, ApiItem]]: items = load_catalog() index = {i.id: i for i in items} return items, index