me
Check API authentication by retrieving the authenticated account's email, plan, and status.
Instructions
[read] Return the authenticated account's email, plan, and status. Use as a smoke test before other calls.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools.ts:124-124 (handler)The handler function for the 'me' tool. It takes no input (z.object({})), makes a GET request to '/api/v1/me' using the FeedbagelClient, and returns the authenticated account's email, plan, and status.
handler: (_, c) => c.request("GET", "/api/v1/me"), - src/tools.ts:123-123 (schema)Input schema for the 'me' tool: an empty object (z.object({})), meaning no parameters are required or accepted.
inputSchema: z.object({}), - src/tools.ts:118-125 (registration)The 'me' tool is defined as an entry in the TOOLS array (ToolDef[]), with name 'me', description, scope 'read', empty input schema, and the handler function. It is registered in the MCP server via the ListToolsRequestSchema and CallToolRequestSchema handlers in src/index.ts.
{ name: "me", description: "Return the authenticated account's email, plan, and status. Use as a smoke test before other calls.", scope: "read", inputSchema: z.object({}), handler: (_, c) => c.request("GET", "/api/v1/me"), }, - src/client.ts:23-55 (helper)The FeedbagelClient.request() method is the helper that actually executes the HTTP request. The 'me' handler calls c.request('GET', '/api/v1/me'), which sends an authenticated GET request to the feedbagel API.
async request( method: string, path: string, body?: unknown, ): Promise<unknown> { const res = await fetch(`${this.baseUrl}${path}`, { method, headers: { Authorization: `Bearer ${this.apiKey}`, ...(body !== undefined ? { "content-type": "application/json" } : {}), }, body: body !== undefined ? JSON.stringify(body) : undefined, }); const text = await res.text(); let json: unknown = undefined; try { json = text ? JSON.parse(text) : undefined; } catch { json = { raw: text }; } if (!res.ok) { // Surface 429 and 4xx details verbatim so the agent sees the cap info. const err: Error & { status?: number; body?: unknown } = new Error( `HTTP ${res.status} ${res.statusText}`, ); err.status = res.status; err.body = json; throw err; } return json; }