Skip to main content
Glama

formula_add

Add or update a formula in a local library to extend your formula collection. Formulas are stored as YAML files organized by category.

Instructions

Add or update a formula in the local library.

    This lets you (and the LLM) extend the local formula collection manually.
    Formulas are persisted as YAML files under ``formulas/library/<category>/``.

    Args:
        id: Unique identifier for the formula (e.g., "custom_drag_force").
           Used as the file name and lookup key.
        name: Human-readable formula name.
        sympy_str: SymPy-compatible expression, e.g. "F_d == 1/2 * rho * v**2 * C_d * A".
        latex: LaTeX representation, e.g. "F_d = \frac{1}{2} \rho v^2 C_d A".
        variables: Mapping of symbol names to metadata, e.g.
                   {"rho": {"description": "density", "unit": "kg/m^3"}}.
        domain: Optional domain tag (e.g., "fluid_dynamics").
        category: Optional category folder name (e.g., "fluid_dynamics").
        description: Optional longer description of the formula.
        aliases: Optional list of alternative names.
        tags: Optional list of tags.
        references: Optional list of references / URLs.
        library_path: Optional custom library directory. Defaults to ``formulas/library``.

    Returns:
        {
            "success": true,
            "formula_id": "custom_drag_force",
            "file_path": "formulas/library/fluid_dynamics/custom_drag_force.yaml",
            "message": "Formula added to local library."
        }

    Example:
        formula_add(
            id="custom_drag_force",
            name="Drag force",
            sympy_str="F_d == 1/2 * rho * v**2 * C_d * A",
            latex="F_d = \frac{1}{2} \rho v^2 C_d A",
            domain="fluid_dynamics",
            category="fluid_dynamics",
            description="Drag force on a body in a fluid.",
            variables={
                "F_d": {"description": "drag force", "unit": "N"},
                "rho": {"description": "density", "unit": "kg/m^3"},
                "v": {"description": "velocity", "unit": "m/s"},
                "C_d": {"description": "drag coefficient"},
                "A": {"description": "reference area", "unit": "m^2"}
            },
            aliases=["drag force", "fluid drag"],
            tags=["drag", "force"],
        )
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
nameYes
tagsNo
latexYes
domainNo
aliasesNo
categoryNo
sympy_strYes
variablesYes
referencesNo
descriptionNo
library_pathNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

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. It discloses that formulas are persisted as YAML files under a specific directory path, and the return value includes success indicator, formula_id, file_path, and message. It also shows an example. However, it does not explicitly state behavior on update (e.g., whether an existing id triggers overwriting) or any destructive implications, but overall it is transparent about the main effects.

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 with a clear opening, bullet-point parameter list, and example. It covers all 12 parameters without being excessively verbose. Minor redundancy between domain and category descriptions, but overall it earns its length.

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 tool's complexity (12 parameters, nested objects, output schema), the description is remarkably complete. It explains persistence, parameter roles, return value structure, and provides a comprehensive example. The optional library_path and default behavior are covered. The presence of an output schema reduces the burden, but the description still adds value on top.

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?

Schema description coverage is 0%, so the description must compensate fully. It provides detailed explanations for every parameter: id as filename and lookup key, sympy_str with example, variables as mapping with metadata, domain/category as folder tags, etc. The description adds significant semantic meaning beyond the bare schema titles, making it easy for an agent to populate arguments correctly.

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 opens with 'Add or update a formula in the local library,' clearly stating both the action and resource. It distinguishes from sibling tools like formula_get or formula_search by emphasizing local library management and manual extension.

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

Usage Guidelines3/5

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

The description says 'This lets you (and the LLM) extend the local formula collection manually,' which provides clear context for when to use. However, it does not explicitly state when not to use this tool or mention alternative tools (e.g., formula_insert if it existed). The usage guidance is adequate but lacks exclusions or comparisons.

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/LBurny/symkit-mcp'

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