Skip to main content
Glama

UK Data: Code utilities

find_peak_element

Read-onlyIdempotent

Finds a peak element in a list where an element is greater than its neighbors. Returns the index of any peak element found. (cost: 1 credit)

Input Schema

NameRequiredDescriptionDefault
numsNoarray, required, list of integers to search

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so the safety profile is covered by structured data. The description adds useful non-structured context: it returns an index rather than a value, and each call costs 1 credit. It does not discuss behavior on empty input, ties, duplicates, or the first/last element edge cases.

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?

Three short sentences, front-loaded with purpose, then return value, then cost. No filler; the credit note is genuinely useful. Slight redundancy in saying both 'finds' and 'returns the index'.

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 single-parameter algorithmic utility with no output schema, the description covers purpose, return type, and cost, which is most of what an agent needs. Missing only edge-case behavior (empty list, single element, duplicates) and input format expectations.

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%, so the schema already documents the single 'nums' parameter. The description only restates it as 'a list', which does not resolve the schema's actual ambiguity between an array of strings and a plain string input, nor the discrepancy between schema coverage and the zero-required-parameters signal.

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 a peak element in a list') and defines the target precisely as an element greater than its neighbors, and adds that the return value is an index. An agent can distinguish it from generic maxima tools like find_max_subarray_sum, though no sibling is named explicitly.

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 use this instead of related array tools such as find_max_subarray_sum, find_majority_element, or binary_search on a rotated array. The phrase 'any peak element' hints that multiple valid answers exist, but no conditions, prerequisites, or alternatives are given.

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