Skip to main content
Glama

Cosine Law

cosine_law
Read-onlyIdempotent

The cosine of the angle opposite side c, as a reduced rational (a^2+b^2-c^2)/(2ab). The sides must form a strict triangle. A right angle returns 0. Price: $0.001 USDC per successful call (x402, Solana). Same tool over HTTPS: POST https://scorptech.it.com/api/x402/v1/cosine-law

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "a": "<a>",
      "b": "<b>",
      "c": "<c>"
    },
    "name": "cosine_law"
  }
}

Input Schema

NameRequiredDescriptionDefault
aYes
bYes
cYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), but the description adds real behavioral detail beyond them: the return encoding as a reduced rational, the strict-triangle domain restriction, the c=right-angle zero case, and the paid-usage model ($0.001 USDC per successful call via x402 on Solana). The HTTPS endpoint is also given, which matters for an agent choosing a transport.

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

Conciseness4/5

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

The definition is front-loaded with the computation and the formula, followed by constraint, edge case, and pricing/transport facts, so every sentence is useful. It is dense and slightly list-like at the end but has no filler.

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?

No output schema exists, and the description compensates by specifying the exact return form (reduced rational) and one known value (right angle -> 0). For a 3-parameter pure function this is nearly complete; the main remaining gap is what is returned or raised when the sides do not form a strict triangle.

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

Parameters4/5

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

Schema description coverage is 0%, so the description has to supply meaning, and it does: a, b, and c are the triangle side lengths, with c opposite the angle being computed, made explicit by the formula. It does not restate that inputs are bounded integers (1 to 1,000,000) or address sign behavior for obtuse angles, so it is strong but not complete.

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 names the exact quantity and the exact formula used: cosine of the angle opposite side c, returned as the reduced rational (a^2+b^2-c^2)/(2ab). That is precise enough to distinguish it from the many other math siblings such as triangle_shape or heron_area without opening the schema.

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 precondition 'The sides must form a strict triangle' and the edge-case rule 'A right angle returns 0' tell an agent when the tool is valid and what a degenerate input yields. It doesn't explicitly name an alternative or state the failure mode for non-triangle inputs, so 4 rather than 5.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources