get_me
Retrieve the authenticated user associated with the current API token.
Instructions
Return the authenticated user for the current API token.
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_me"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- humaans_mcp/server.py:28-31 (handler)The get_me tool handler: an async function decorated with @mcp.tool() that calls the Humaans API's /me endpoint via the client and returns the authenticated user info for the current API token.
@mcp.tool() async def get_me() -> dict[str, Any]: """Return the authenticated user for the current API token.""" return await client().get("/me") - humaans_mcp/server.py:28-28 (registration)The tool is registered via the @mcp.tool() decorator on line 28, which makes the get_me function available as an MCP tool.
@mcp.tool() - humaans_mcp/client.py:20-75 (helper)The HumaansClient class used by get_me. The get() method (lines 34-43) performs the actual HTTP GET request to the Humaans API, which get_me calls with path '/me'.
class HumaansClient: def __init__(self, token: str | None = None): token = token or os.environ.get("HUMAANS_API_TOKEN") if not token: raise RuntimeError("HUMAANS_API_TOKEN environment variable is required") self._client = httpx.AsyncClient( base_url=BASE_URL, headers={"Authorization": f"Bearer {token}"}, timeout=DEFAULT_TIMEOUT, ) async def aclose(self) -> None: await self._client.aclose() 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() async def list_page( self, path: str, filters: dict[str, Any] | None = None, limit: int = 100, skip: int = 0, ) -> Any: params = dict(filters or {}) params["$limit"] = limit params["$skip"] = skip return await self.get(path, params) async def list_all( self, path: str, filters: dict[str, Any] | None = None, cap: int = MAX_LIST_ALL, ) -> list[dict[str, Any]]: collected: list[dict[str, Any]] = [] skip = 0 while len(collected) < cap: page = await self.list_page(path, filters=filters, limit=PAGE_SIZE, skip=skip) items = page.get("data") if isinstance(page, dict) else page if not items: break collected.extend(items) if len(items) < PAGE_SIZE: break skip += PAGE_SIZE return collected[:cap]