calcslive_validate
Validate calculation articles to identify available inputs and outputs with their units before performing calculations. Use this tool to understand required parameters and their measurement options.
Instructions
Discover available inputs and outputs for a calculation article. Use this before calculate to understand what parameters are available and their units. Returns article metadata including all input/output PQs with descriptions, units, and available unit options.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| articleId | Yes | Article Short ID to validate (e.g., 'hydro-power-calc') |
Implementation Reference
- src/index.ts:287-321 (handler)Handler for the calcslive_validate tool: sends a GET request to the CalcsLive API validate endpoint and returns the article metadata as formatted JSON content.if (request.params.name === "calcslive_validate") { const { articleId } = request.params.arguments as any; try { const response = await fetch( `${CALCSLIVE_API_BASE}/api/v1/validate?articleId=${articleId}&apiKey=${API_KEY}` ); if (!response.ok) { const errorData = await response.json() as any; throw new Error(errorData.error?.message || `API error: ${response.status}`); } const result = await response.json() as any; return { content: [ { type: "text", text: JSON.stringify(result.data.article, null, 2), }, ], }; } catch (error: any) { return { content: [ { type: "text", text: `Error validating article: ${error.message}`, }, ], isError: true, }; } }
- src/index.ts:169-181 (registration)Tool registration in listTools handler, defining name, description, and input schema for calcslive_validate.name: "calcslive_validate", description: "Discover available inputs and outputs for a calculation article. Use this before calculate to understand what parameters are available and their units. Returns article metadata including all input/output PQs with descriptions, units, and available unit options.", inputSchema: { type: "object", properties: { articleId: { type: "string", description: "Article Short ID to validate (e.g., 'hydro-power-calc')" } }, required: ["articleId"] } }
- src/index.ts:171-180 (schema)Input schema definition for the calcslive_validate tool.inputSchema: { type: "object", properties: { articleId: { type: "string", description: "Article Short ID to validate (e.g., 'hydro-power-calc')" } }, required: ["articleId"] }