Skip to main content
Glama

UK Data: Code utilities

find_equilibrium_index

Read-onlyIdempotent

Finds the equilibrium index in an array where the sum of elements to the left equals the sum of elements to the right. Returns -1 if no such index exists. (cost: 1 credit)

Input Schema

NameRequiredDescriptionDefault
arrNoarray of numbers, required, the input array to search, no units, no default

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare read-only, idempotent, non-destructive behavior, so the bar is lower. The description still adds real value beyond them by disclosing the -1 sentinel return for the no-solution case and the 1-credit cost, both of which affect how an agent interprets results and budgets calls.

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?

Two tightly written sentences: the operation and its condition first, then the failure return and cost. Nothing is redundant and the most important information is front-loaded.

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?

For a simple, deterministic computation with no output schema, the description supplies the definition and the failure sentinel, which is most of what an agent needs. The remaining gap is the accepted input encoding, given the schema's string-or-array union.

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 coverage is 100% for the single parameter, so the schema carries the load and baseline 3 applies. The description adds nothing about accepted input forms, notably that the schema permits a plain string as well as an array, which is a non-obvious quirk an agent could get wrong.

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 names a specific operation and defines the equilibrium index precisely (left sum equals right sum), so an agent knows exactly what is computed. It does not differentiate itself from adjacent array-algorithm siblings like find_peak_element or find_majority_element, but the concept itself is self-disambiguating.

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?

There is no explicit when-to-use or when-not-to-use guidance and no mention of sibling tools. Usage is only implied by the mathematical definition, which is unambiguous but leaves the agent to infer applicability.

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