Skip to main content
Glama

Factor Expression

factor_expression
Idempotent

Factor any mathematical expression or integer into irreducible components, simplifying equations and revealing structure. Provide an expression like 'x^2 - 1' or '60' to get the factored form.

Instructions

Factor a mathematical expression or integer

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionNoWorkspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the same workspace across reconnects and is a bearer credential -- keep it secret. Omit for 'default'.default
expressionYesExpression to factor (e.g., 'x^2 - 1' or '60')

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.7.0
    • changedInput schema / properties / session / description
      Previous value: -"Named workspace to use. Workspaces have independent variables; omit for 'default'."New value: +"Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the same workspace across reconnects and is a bearer credential -- keep it secret. Omit for 'default'."
  2. Changed1 schema field changedv0.5.0
    • addedInput schema / properties / session
      Added value: +{
      +  "default": "default",
      +  "description": "Named workspace to use. Workspaces have independent variables; omit for 'default'.",
      +  "type": "string"
      +}
  3. First observedv0.3.1

TDQS

C2.9/5.0
Behavior2/5

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

Annotations provide idempotentHint=true and destructiveHint=false, but the description adds no behavioral context of its own. Notably, readOnlyHint=false suggests possible side effects (likely session/workspace interaction), yet the description says nothing about this or about failure behavior for unfactorable expressions. With no annotation coverage of these behaviors, the description leaves a real transparency gap.

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?

A single front-loaded sentence with zero redundancy. It is appropriately sized for the tool's simplicity, though it contributes little beyond the title 'Factor Expression' aside from the 'or integer' qualifier.

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

Completeness3/5

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

For a straightforward computation with full schema coverage and an output schema present, the definition is minimally adequate. The notable gap is the large sibling family (simplify, expand, solve, calculate) with no guidance on when factoring is the correct operation — an agent gets no help in selecting among them. The detailed session description in the schema partially compensates.

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% — both 'session' (with workspace semantics and credential warning) and 'expression' (with examples) are fully documented. The tool description adds nothing beyond what the schema already states, so the baseline 3 applies.

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

Purpose4/5

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

The description states a specific verb ('factor') and resource ('a mathematical expression or integer'), which semantically distinguishes it from siblings like simplify_expression, expand_expression, and calculate_expression. However, it provides no explicit sibling differentiation; the agent must infer the distinction purely from the verb.

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

Usage Guidelines2/5

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

There is no guidance on when to choose this tool over the many math siblings (simplify_expression, expand_expression, solve_equation, evaluate_sage). The schema examples ('x^2 - 1', '60') illustrate inputs but do not explain selection criteria, and no alternatives or exclusions are named.

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