Skip to main content
Glama
CalcsLive

CalcsLive MCP Server

by CalcsLive

calcslive_calculate

Perform unit-aware engineering calculations with automatic unit conversions and dependency resolution using CalcsLive articles. Input values with units to get calculated outputs.

Instructions

Perform unit-aware engineering calculations using CalcsLive articles. Automatically handles unit conversions and dependency calculations. Example: Calculate hydro power with flow rate 150 m³/s and head 25m. Returns calculated outputs with values and units.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
articleIdYesArticle Short ID (e.g., 'pump-calc-abc'). Use calcslive_validate to discover available articles.
inputsYesInput PQ values with units. Example: {velocity: {value: 25, unit: 'm/s'}, mass: {value: 1500, unit: 'kg'}}
outputsNoOptional output unit preferences. Example: {distance: {unit: 'km'}}

Implementation Reference

  • Executes the calcslive_calculate tool by POSTing articleId, inputs, and outputs to the CalcsLive API calculate endpoint, then returns the formatted calculation result or error.
    if (request.params.name === "calcslive_calculate") {
      const { articleId, inputs, outputs = {} } = request.params.arguments as any;
    
      try {
        const response = await fetch(`${CALCSLIVE_API_BASE}/api/v1/calculate`, {
          method: "POST",
          headers: {
            "Content-Type": "application/json",
          },
          body: JSON.stringify({
            articleId,
            apiKey: API_KEY,
            inputs,
            outputs
          }),
        });
    
        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;
    
        // Format response for MCP
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(result.data.calculation, null, 2),
            },
          ],
        };
      } catch (error: any) {
        return {
          content: [
            {
              type: "text",
              text: `Error performing calculation: ${error.message}`,
            },
          ],
          isError: true,
        };
      }
    }
  • src/index.ts:52-96 (registration)
    Registers the calcslive_calculate tool in the ListTools response, including name, description, and detailed inputSchema for articleId, inputs (with value/unit), and optional outputs.
    {
      name: "calcslive_calculate",
      description: "Perform unit-aware engineering calculations using CalcsLive articles. Automatically handles unit conversions and dependency calculations. Example: Calculate hydro power with flow rate 150 m³/s and head 25m. Returns calculated outputs with values and units.",
      inputSchema: {
        type: "object",
        properties: {
          articleId: {
            type: "string",
            description: "Article Short ID (e.g., 'pump-calc-abc'). Use calcslive_validate to discover available articles."
          },
          inputs: {
            type: "object",
            description: "Input PQ values with units. Example: {velocity: {value: 25, unit: 'm/s'}, mass: {value: 1500, unit: 'kg'}}",
            additionalProperties: {
              type: "object",
              properties: {
                value: {
                  type: "number",
                  description: "Numeric value for this input"
                },
                unit: {
                  type: "string",
                  description: "Unit for this value (e.g., 'm/s', 'kg', 'kW'). Supports both superscript (m³) and caret (m^3) notation."
                }
              },
              required: ["value", "unit"]
            }
          },
          outputs: {
            type: "object",
            description: "Optional output unit preferences. Example: {distance: {unit: 'km'}}",
            additionalProperties: {
              type: "object",
              properties: {
                unit: {
                  type: "string",
                  description: "Desired output unit (optional)"
                }
              }
            }
          }
        },
        required: ["articleId", "inputs"]
      }
    },
  • Input schema definition for the calcslive_calculate tool, specifying structure for articleId, inputs as objects with value and unit, and optional outputs.
    inputSchema: {
      type: "object",
      properties: {
        articleId: {
          type: "string",
          description: "Article Short ID (e.g., 'pump-calc-abc'). Use calcslive_validate to discover available articles."
        },
        inputs: {
          type: "object",
          description: "Input PQ values with units. Example: {velocity: {value: 25, unit: 'm/s'}, mass: {value: 1500, unit: 'kg'}}",
          additionalProperties: {
            type: "object",
            properties: {
              value: {
                type: "number",
                description: "Numeric value for this input"
              },
              unit: {
                type: "string",
                description: "Unit for this value (e.g., 'm/s', 'kg', 'kW'). Supports both superscript (m³) and caret (m^3) notation."
              }
            },
            required: ["value", "unit"]
          }
        },
        outputs: {
          type: "object",
          description: "Optional output unit preferences. Example: {distance: {unit: 'km'}}",
          additionalProperties: {
            type: "object",
            properties: {
              unit: {
                type: "string",
                description: "Desired output unit (optional)"
              }
            }
          }
        }
      },
      required: ["articleId", "inputs"]
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: automatic unit conversions, dependency calculations, and the return format ('calculated outputs with values and units'). However, it doesn't mention error handling, performance characteristics, or authentication requirements that might be relevant for a calculation service.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly sized with three sentences that each earn their place: purpose statement, key capabilities, and concrete example with return format. It's front-loaded with the core functionality and wastes no words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a calculation tool with 3 parameters, 100% schema coverage, and no output schema, the description provides good context about what the tool does and how it behaves. The main gap is the lack of output schema, which means the description doesn't detail the structure of returned results beyond mentioning 'values and units'.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, providing comprehensive parameter documentation. The description adds minimal value beyond the schema - it mentions 'unit-aware engineering calculations' which aligns with the schema's unit handling, but doesn't provide additional syntax, format details, or constraints beyond what's already in the schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Perform unit-aware engineering calculations'), the resource ('CalcsLive articles'), and distinguishes from siblings by focusing on calculation rather than validation or script execution. The hydro power example concretely illustrates the purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool (engineering calculations with unit handling) and references a sibling tool ('calcslive_validate' for discovering articles). However, it doesn't explicitly state when NOT to use it or provide alternatives beyond the validation reference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/CalcsLive/calcslive-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server