bbq_analyze_device_reading
Analyzes temperature readings from ThermoWorks BBQ devices to provide cooking insights, detect stalls, estimate cook times, and offer protein-specific recommendations.
Instructions
Analyze temperature readings from a ThermoWorks device (Signals, Smoke, BlueDOT).
Simulates integration with ThermoWorks Cloud to provide analysis of multi-probe readings.
Args:
device_type: Type of ThermoWorks device ('Signals', 'Smoke', 'BlueDOT')
probe_readings: Array of probe readings with {probe_id, name, temperature}
protein_type: Type of protein being cooked (optional)
target_temp: Target temperature (optional)
response_format: 'markdown' or 'json'
Examples:
"Signals reading: Probe 1 at 165°F, Ambient at 250°F"
"Smoke shows 180°F on the meat probe"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device_type | Yes | Type of ThermoWorks device | |
| probe_readings | Yes | Temperature readings from each probe | |
| protein_type | No | Type of protein being cooked (if known) | |
| target_temp | No | Target temperature set on device | |
| response_format | No | Output format | markdown |
Implementation Reference
- src/index.ts:850-903 (handler)The inline asynchronous handler function for the bbq_analyze_device_reading tool. It identifies the meat probe from readings, optionally performs temperature analysis if protein_type and target_temp are provided using analyzeTemperature, formats the output as markdown using formatDeviceReadingMarkdown or JSON, and handles errors.async (params: SimulateDeviceReadingInput) => { try { // Find the meat probe (not ambient) const meatProbe = params.probe_readings.find( (p) => !p.probe_id.toLowerCase().includes("ambient") && !p.name?.toLowerCase().includes("ambient") ); let analysis: ReturnType<typeof analyzeTemperature> | undefined; if (meatProbe && params.protein_type && params.target_temp) { analysis = analyzeTemperature( meatProbe.temperature, params.target_temp, params.protein_type ); } if (params.response_format === "json") { const output = { deviceType: params.device_type, probeReadings: params.probe_readings, proteinType: params.protein_type, targetTemp: params.target_temp, analysis: analysis ? { currentTemp: analysis.currentTemp, targetTemp: analysis.targetTemp, percentComplete: analysis.percentComplete, tempDelta: analysis.tempDelta, recommendations: analysis.recommendations, } : null, }; return { content: [{ type: "text", text: JSON.stringify(output, null, 2) }], structuredContent: output, }; } const markdown = formatDeviceReadingMarkdown( params.device_type, params.probe_readings, analysis ); return { content: [{ type: "text", text: markdown }], }; } catch (error) { const message = error instanceof Error ? error.message : "Unknown error occurred"; return { isError: true, content: [{ type: "text", text: `Error analyzing device reading: ${message}` }], }; }
- src/index.ts:824-905 (registration)Registration of the bbq_analyze_device_reading tool on the MCP server, including title, description, input schema (SimulateDeviceReadingSchema), annotations, and reference to the inline handler.server.registerTool( "bbq_analyze_device_reading", { title: "Analyze ThermoWorks Device Reading", description: `Analyze temperature readings from a ThermoWorks device (Signals, Smoke, BlueDOT). Simulates integration with ThermoWorks Cloud to provide analysis of multi-probe readings. Args: - device_type: Type of ThermoWorks device ('Signals', 'Smoke', 'BlueDOT') - probe_readings: Array of probe readings with {probe_id, name, temperature} - protein_type: Type of protein being cooked (optional) - target_temp: Target temperature (optional) - response_format: 'markdown' or 'json' Examples: - "Signals reading: Probe 1 at 165°F, Ambient at 250°F" - "Smoke shows 180°F on the meat probe"`, inputSchema: SimulateDeviceReadingSchema, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false, }, }, async (params: SimulateDeviceReadingInput) => { try { // Find the meat probe (not ambient) const meatProbe = params.probe_readings.find( (p) => !p.probe_id.toLowerCase().includes("ambient") && !p.name?.toLowerCase().includes("ambient") ); let analysis: ReturnType<typeof analyzeTemperature> | undefined; if (meatProbe && params.protein_type && params.target_temp) { analysis = analyzeTemperature( meatProbe.temperature, params.target_temp, params.protein_type ); } if (params.response_format === "json") { const output = { deviceType: params.device_type, probeReadings: params.probe_readings, proteinType: params.protein_type, targetTemp: params.target_temp, analysis: analysis ? { currentTemp: analysis.currentTemp, targetTemp: analysis.targetTemp, percentComplete: analysis.percentComplete, tempDelta: analysis.tempDelta, recommendations: analysis.recommendations, } : null, }; return { content: [{ type: "text", text: JSON.stringify(output, null, 2) }], structuredContent: output, }; } const markdown = formatDeviceReadingMarkdown( params.device_type, params.probe_readings, analysis ); return { content: [{ type: "text", text: markdown }], }; } catch (error) { const message = error instanceof Error ? error.message : "Unknown error occurred"; return { isError: true, content: [{ type: "text", text: `Error analyzing device reading: ${message}` }], }; } } );
- src/schemas/index.ts:233-253 (schema)Zod schema definition for input validation of the bbq_analyze_device_reading tool, defining parameters like device_type, probe_readings array, optional protein_type, target_temp, and response_format.export const SimulateDeviceReadingSchema = z .object({ device_type: z.enum(["Signals", "Smoke", "BlueDOT"]).describe("Type of ThermoWorks device"), probe_readings: z .array( z.object({ probe_id: z.string().describe("Probe identifier (e.g., 'probe1', 'ambient')"), name: z.string().optional().describe("Custom name for this probe"), temperature: z.number().describe("Temperature reading"), }) ) .min(1) .max(4) .describe("Temperature readings from each probe"), protein_type: ProteinTypeSchema.optional().describe("Type of protein being cooked (if known)"), target_temp: z.number().optional().describe("Target temperature set on device"), response_format: ResponseFormatSchema.describe("Output format"), }) .strict(); export type SimulateDeviceReadingInput = z.infer<typeof SimulateDeviceReadingSchema>;
- src/services/formatting.ts:241-259 (helper)Helper function to format the device readings and optional temperature analysis into a readable Markdown output for the tool response.export function formatDeviceReadingMarkdown( deviceType: string, probeReadings: Array<{ probe_id: string; name?: string; temperature: number }>, analysis?: TemperatureAnalysis ): string { let output = `## 📱 ThermoWorks ${deviceType} Reading\n\n`; for (const probe of probeReadings) { const name = probe.name || probe.probe_id; output += `**${name}:** ${probe.temperature}°F\n`; } if (analysis) { output += `\n---\n\n`; output += formatTemperatureAnalysisMarkdown(analysis); } return output; }