Skip to main content
Glama

UK Data: Code utilities

find_max_subarray_sum

Read-onlyIdempotent

Finds the maximum sum of any contiguous subarray using Kadane's algorithm. (cost: 1 credit)

Input Schema

NameRequiredDescriptionDefault
numsNoarray of numbers, required, the list of integers to analyze

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already establish the safety profile (readOnly, idempotent, non-destructive), so the description only needs to add context beyond that — and it does: naming Kadane's algorithm signals the O(n) single-pass behavior and that overlapping subarrays are considered, while the '(cost: 1 credit)' note discloses a billing trait found nowhere in the annotations.

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 covering what the tool does plus a short cost tag; there is no padding or redundancy. The credit note is slightly orthogonal to the core operation but is genuinely useful and costs only a parenthetical.

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 one-parameter, annotation-covered tool this is close to sufficient, but with no output schema the description leaves the return value underspecified — it implies a numeric maximum sum but never says whether the subarray indices are returned, nor how empty or all-negative inputs are handled.

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%, so the input contract is already documented in structured form and the baseline is 3. The description adds nothing about the 'nums' parameter — notably it does not clarify the mismatch between the schema's string/array-of-strings typing and the documented 'list of integers'.

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 and resource — 'Finds the maximum sum of any contiguous subarray' — and even names the algorithm (Kadane's), which unambiguously separates it from sibling find_* tools like find_peak_element or find_majority_element. It stops short of explicitly contrasting with those siblings, so it is clear but not maximally differentiated.

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 narrow, single-purpose name makes the intended use obvious by implication, but the description offers no explicit when-to-use guidance, no statement of when not to use it, and no pointer to any alternative tool. Adequate but with clear gaps.

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