Skip to main content
Glama

get_next_sequence_value

Fetch the next value from an Oracle sequence, advancing its counter for unique IDs. Verify cached values against the target table before use as a key.

Instructions

Return the NEXTVAL of a sequence. WARNING: this is a side-effecting read — calling it advances the sequence counter and the consumed value cannot be reused. When the sequence has cache > 0 the returned value may already be consumed elsewhere; before using it as a key, verify it is not already present in the target table. Use sparingly.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
schemaNoSchema (owner) of the sequence. Optional — defaults to the server's current schema; omit rather than guess.
sequenceYesSequence name.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.16.3

TDQS

A4.2/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden, and it does so well: it discloses non-idempotence (advances the counter, value cannot be reused) and the cache>0 hazard that makes the returned value potentially already-consumed. It omits failure/privilege behavior and the concrete return type, which are the remaining gaps for a tool with zero annotation coverage.

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?

Four short sentences, front-loaded with the core action and then escalating to the warning. Every sentence adds a distinct fact (what it returns, that it mutates, the cache caveat, the sparing-use advice) with no filler.

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?

With no annotations and no output schema, the description must carry the behavioral contract, and it covers the critical side-effect and correctness risks thoroughly. It stops short of naming the sibling alternative for obtaining safe keys and does not state error behavior, leaving minor gaps.

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% and both parameters (schema, sequence) are documented there, including the 'omit rather than guess' default for schema. The description adds no parameter-level meaning beyond the schema, so the baseline of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Return the NEXTVAL of a sequence') and immediately frames the operation as a side-effecting read, which separates it from the read-only list_*/get_* siblings. An agent can distinguish it from list_sequences, get_sequence_info and create_sequence without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear operational context ('Use sparingly') and a concrete pre-use condition: verify the value is not already present in the target table when cache > 0. It does not name an alternative tool (e.g. find_free_id, which exists among siblings and serves a similar key-generation need), so the routing guidance is incomplete but the caution guidance is genuinely useful.

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