Skip to main content
Glama
IBM

Physics MCP Server

by IBM

calculate_hookes_law

Calculate spring force and elastic potential energy using Hooke's Law. Input spring constant and displacement to determine restoring force magnitude and stored energy for springs and elastic materials.

Instructions

Calculate spring force using Hooke's Law: F = -kx.

The restoring force is proportional to displacement from equilibrium.
Fundamental for springs, elastic materials, and simple harmonic motion.

Args:
    spring_constant: Spring constant k in N/m (stiffness)
    displacement: Displacement from equilibrium in meters

Returns:
    Dict containing:
        - force: Restoring force magnitude in Newtons
        - potential_energy: Elastic potential energy in Joules

Tips for LLMs:
    - Stiffer spring → larger k → more force for same displacement
    - Potential energy stored in spring: PE = (1/2)kx²
    - Negative sign in F = -kx means force opposes displacement

Example - Compressing a car spring:
    result = await calculate_hookes_law(
        spring_constant=10000,  # N/m (stiff car spring)
        displacement=0.05  # 5cm compression
    )
    # Force = 500 N, PE = 12.5 J

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spring_constantYes
displacementYes
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's behavior: it calculates force and potential energy based on Hooke's Law, explains the negative sign meaning, and includes tips on how stiffness affects force. It also provides a detailed example with inputs and outputs, clarifying the return format and units. However, it does not mention error handling, rate limits, or authentication needs, which could be relevant for a simulation tool.

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 description is well-structured and appropriately sized, starting with the core purpose, followed by context, args, returns, tips, and an example. Each section adds value, but it could be slightly more concise by integrating the formula explanation into the purpose statement. Overall, it is efficient with minimal waste.

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

Completeness5/5

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

Given the complexity (a physics calculation tool with no annotations, no output schema, and low schema coverage), the description is highly complete. It covers purpose, usage, parameters, return values (including units), behavioral tips, and a practical example. This provides all necessary context for an AI agent to invoke the tool correctly without relying on structured fields.

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

Parameters5/5

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

The input schema has 0% description coverage, so the description must fully compensate. It does so excellently: it defines both parameters ('spring_constant' and 'displacement') with clear semantics, units (N/m and meters), and explanations (e.g., 'stiffness'). The tips and example further enhance understanding, adding value beyond the bare schema.

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 explicitly states the tool's purpose: 'Calculate spring force using Hooke's Law: F = -kx.' It specifies the verb ('calculate'), resource ('spring force'), and formula, clearly distinguishing it from sibling tools like 'calculate_force' or 'calculate_potential_energy' by focusing on Hooke's Law specifically.

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: 'Fundamental for springs, elastic materials, and simple harmonic motion.' It implies usage in physics simulations involving springs or elasticity. However, it does not explicitly state when not to use it or name alternatives among the many sibling tools, such as 'calculate_simple_harmonic_motion' or 'calculate_damped_oscillation'.

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/IBM/chuk-mcp-physics'

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