Skip to main content
Glama

UK Data: Code utilities

find_duplicate_number

Read-onlyIdempotent

Finds the duplicate number in a list of integers where exactly one number appears more than once. Returns the duplicate value. (cost: 1 credit)

Input Schema

NameRequiredDescriptionDefault
numsNoarray, required, list of integers containing one duplicate

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 cover the safety profile (readOnly, idempotent, non-destructive), so the bar is lower, yet the description still adds real context: the one-duplicate precondition, the returned value, and a per-call cost of 1 credit. It stops short of saying what happens on invalid input (no duplicate or multiple duplicates), which keeps it from a 5.

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?

Three short sentences, each earning its place: the operation and precondition first, the return value second, the credit cost last. Nothing redundant and the important constraint 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 one-parameter pure-computation tool with rich annotations and no output schema, the description covers purpose, precondition, output, and cost. The only missing piece is error behaviour when the input does not contain exactly one duplicate, which is a minor but real gap.

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 baseline is 3. The description does add that the list contains integers with exactly one duplicate, which sharpens the schema's looser "array of strings or string" typing, but it gives no format, separator, or size guidance for the string form.

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?

States a specific verb and resource ("Finds the duplicate number in a list of integers") plus the key precondition that exactly one number repeats, which distinguishes it from broader siblings like find_majority_element or find_missing_number. It is clear on its own, though it never names a sibling or explicitly rules out near-neighbours such as find_missing_number.

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 precondition "where exactly one number appears more than once" implies the correct input context, but there is no explicit when-to-use/when-not-to-use guidance and no mention of alternatives for lists that violate that precondition. Usage is inferable rather than stated.

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