toggl_check_auth
Verify Toggl API connectivity and authentication status to ensure proper integration with time tracking workflows.
Instructions
Verify Toggl API connectivity and authentication is valid
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:397-421 (handler)The main handler implementation for the 'toggl_check_auth' tool. It checks authentication by fetching the current user and workspaces via the TogglAPI, masks the email for privacy, and returns structured JSON response.case 'toggl_check_auth': { const me = await api.getMe(); const workspaces = await api.getWorkspaces(); const maskEmail = (e?: string) => { if (!e) return undefined as unknown as string; const [user, domain] = e.split('@'); if (!domain) return '***'; const u = user.length <= 2 ? '*'.repeat(user.length) : `${user[0]}***${user.slice(-1)}`; return `${u}@${domain}`; }; return { content: [{ type: 'text', text: JSON.stringify({ authenticated: true, user: { id: (me as any).id, email: maskEmail((me as any).email), fullname: (me as any).fullname }, workspaces: workspaces.map(w => ({ id: w.id, name: w.name })), }, null, 2) }] }; }
- src/index.ts:140-147 (schema)The schema definition for the 'toggl_check_auth' tool, specifying its name, description, and empty input schema (no parameters required).name: 'toggl_check_auth', description: 'Verify Toggl API connectivity and authentication is valid', inputSchema: { type: 'object', properties: {}, required: [] }, },
- src/index.ts:386-388 (registration)Registration of the tools list handler, which exposes the 'toggl_check_auth' tool (among others) via ListToolsRequestSchema.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });
- src/index.ts:391-391 (registration)Registration of the CallToolRequestSchema handler, which includes the switch statement dispatching to the 'toggl_check_auth' case.server.setRequestHandler(CallToolRequestSchema, async (request) => {