Skip to main content
Glama

gradient_descent_steps

Runs batch or stochastic gradient descent steps for linear regression, updating model weights to reduce squared error using input data, learning rate, and step count.

Instructions

Gradient descent on squared error for a linear model. mode: batch | stochastic. weights = [w0, w1, ...].

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": {
      "X": "<X>",
      "y": "<y>",
      "weights": "<weights>"
    },
    "name": "gradient_descent_steps"
  }
}

Input Schema

NameRequiredDescriptionDefault
XYes
yYes
modeNobatch
alphaNo
stepsNo
weightsYes
fold_twoNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

C2.8/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden. It identifies the algorithm, squared-error gradient descent, and the mode options, but it omits side effects, whether weights are mutated or returned, stochastic randomness behavior, and other operational details.

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 two short sentences, front-loaded with the core algorithm and then the mode and weights details. There is no redundant filler; any thinness is a completeness issue rather than verbosity.

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

Completeness2/5

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

For a 7-parameter tool with 0% schema coverage and no annotations, the description is far too sparse, especially regarding fold_two and usage guidance. The presence of an output schema reduces the need to explain return values, but major parameter and behavioral gaps remain.

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

Parameters2/5

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

Schema description coverage is 0%, and the description explains only two parameter concepts: mode as batch or stochastic, and weights as [w0, w1, ...]. The roles of X, y, alpha, steps, and especially fold_two remain undefined.

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 algorithm and resource: gradient descent on squared error for a linear model, and specifies the weights format. It is clear what the tool does, but it does not distinguish itself from siblings such as linear_regression_fit or weight_update.

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 when-to-use guidance, no when-not-to-use guidance, and no named alternatives. The only selection hint is listing mode values batch and stochastic, leaving the choice between modes and sibling tools entirely to inference.

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