thermoworks_check_auth
Verify authentication status and token expiry for ThermoWorks Cloud integration to enable real-time BBQ temperature monitoring and cooking guidance.
Instructions
Check if you're currently authenticated with ThermoWorks Cloud.
Returns: Authentication status and token expiry time.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:1090-1123 (handler)The handler function that implements the core logic of the thermoworks_check_auth tool. It checks the ThermoWorks client's authentication status and returns appropriate markdown content and structured data indicating whether the user is authenticated, along with user ID and token expiry information.async (_params: CheckAuthStatusInput) => { const client = getThermoWorksClient(); const isAuth = client.isAuthenticated(); const authInfo = client.getAuthInfo(); if (!isAuth) { return { content: [ { type: "text", text: `## 🔒 Not Authenticated\n\nUse \`thermoworks_authenticate\` to connect to ThermoWorks Cloud.`, }, ], structuredContent: { authenticated: false }, }; } const output = { authenticated: true, userId: authInfo.userId, tokenExpiry: authInfo.tokenExpiry?.toISOString(), tokenValid: authInfo.tokenExpiry ? authInfo.tokenExpiry > new Date() : false, }; return { content: [ { type: "text", text: `## ✅ Authenticated\n\n**User ID:** ${authInfo.userId}\n**Token Expires:** ${authInfo.tokenExpiry?.toLocaleString()}`, }, ], structuredContent: output, }; }
- src/schemas/auth.ts:81-86 (schema)Zod schema definition for the tool's input parameters. This schema defines an empty object (no required parameters) with strict mode./** * Schema for checking authentication status */ export const CheckAuthStatusSchema = z.object({}).strict(); export type CheckAuthStatusInput = z.infer<typeof CheckAuthStatusSchema>;
- src/index.ts:1074-1124 (registration)The server.registerTool call that registers the thermoworks_check_auth tool with the MCP server, specifying its metadata, input schema, annotations, and inline handler function.server.registerTool( "thermoworks_check_auth", { title: "Check ThermoWorks Auth Status", description: `Check if you're currently authenticated with ThermoWorks Cloud. Returns: Authentication status and token expiry time.`, inputSchema: CheckAuthStatusSchema, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false, }, }, async (_params: CheckAuthStatusInput) => { const client = getThermoWorksClient(); const isAuth = client.isAuthenticated(); const authInfo = client.getAuthInfo(); if (!isAuth) { return { content: [ { type: "text", text: `## 🔒 Not Authenticated\n\nUse \`thermoworks_authenticate\` to connect to ThermoWorks Cloud.`, }, ], structuredContent: { authenticated: false }, }; } const output = { authenticated: true, userId: authInfo.userId, tokenExpiry: authInfo.tokenExpiry?.toISOString(), tokenValid: authInfo.tokenExpiry ? authInfo.tokenExpiry > new Date() : false, }; return { content: [ { type: "text", text: `## ✅ Authenticated\n\n**User ID:** ${authInfo.userId}\n**Token Expires:** ${authInfo.tokenExpiry?.toLocaleString()}`, }, ], structuredContent: output, }; } );