get_token_info
Retrieve metadata for the current API token, including scopes and owner details.
Instructions
Return metadata about the current API token (scopes, owner, etc.).
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_token_info"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- humaans_mcp/server.py:34-37 (handler)The tool handler for 'get_token_info'. It is decorated with @mcp.tool(), making it an MCP tool. It calls the Humaans API endpoint /token-info via the HTTP client and returns the response.
@mcp.tool() async def get_token_info() -> dict[str, Any]: """Return metadata about the current API token (scopes, owner, etc.).""" return await client().get("/token-info") - humaans_mcp/server.py:28-34 (registration)The tool is registered via the @mcp.tool() decorator from FastMCP on the 'mcp' instance defined on line 7 (mcp = FastMCP('humaans')).
@mcp.tool() async def get_me() -> dict[str, Any]: """Return the authenticated user for the current API token.""" return await client().get("/me") @mcp.tool() - humaans_mcp/client.py:34-43 (helper)The client().get() method used by the handler to make the HTTP GET request to the Humaans API.
async def get(self, path: str, params: dict[str, Any] | None = None) -> Any: clean = {k: v for k, v in (params or {}).items() if v is not None} resp = await self._client.get(path, params=clean) if resp.status_code >= 400: try: body = resp.json() except Exception: body = resp.text raise HumaansError(resp.status_code, path, body) return resp.json()