Skip to main content
Glama

Decodificar ObjectId de MongoDB

objectid-decode
Read-onlyIdempotent

Valida un ObjectId de MongoDB y extrae su fecha de creación. Cuándo: hay que generar un identificador en este formato o leer los campos que lleva dentro. No para: decodificar un KSUID de 27 caracteres en fecha y payload de 128 bits (ksuid-decode). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.

EN: Validates a 24-hex MongoDB ObjectId and extracts its embedded creation time (seconds precision) and the random/counter parts. When: an identifier has to be generated in this format or its embedded fields decoded. Not for: decoding a 27-char base62 KSUID into its timestamp (ksuid-decode). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB.

Input Schema

NameRequiredDescriptionDefault
objectidYes24 hex chars (string; required; up to 64 chars).

Output Schema

NameRequiredDescriptionDefault
validNo
counterNo
timestampNo
random_hexNo
timestamp_sNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / objectid / examples
      Added value: +[
      +  "507f1f77bcf86cd799439011"
      +]
  2. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, openWorldHint=false and destructiveHint=false, so the safety profile is covered; the description nonetheless adds genuinely new behavioral facts not present in annotations: no network access, no stored state, and concrete operational limits (64 KB input, 1 s per call, 1 MB result). The 'deterministic / no side effects' lines largely restate the annotations, 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.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The labelled structure (When / Not for / Side effects / Deterministic / Limits) is front-loaded and scannable, and every sentence is on topic. However, the full Spanish-then-English duplication roughly doubles the length, repeating the same content twice with no compression or cross-reference.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be explained, and annotations carry the safety profile; the description still supplies the limits, the sibling exclusion, and the deterministic/no-network guarantees. For a single-parameter decoder, nothing an agent needs in order to call it correctly is missing.

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 the single parameter is already documented in the schema ('24 hex chars... up to 64 chars'), so the baseline is 3. The description reinforces the 24-hex requirement but adds no syntax, normalization or error-condition detail about the input beyond what the schema states.

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 resources ('Valida un ObjectId de MongoDB y extrae su fecha de creación') and names the exact decoding components (creation time in seconds, random/counter parts), so the agent knows precisely what the tool returns. It is differentiated from a named sibling (ksuid-decode) by length/charset. Minor blemish: the 'When' clause mentions generating an identifier, which this read-only decoder cannot do, slightly blurring the purpose.

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

Usage Guidelines5/5

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

The description gives an explicit 'Cuándo/When' trigger and an explicit 'No para/Not for' exclusion that names the alternative tool (ksuid-decode) and its defining characteristic (27-char base62 KSUID). There is no inference required to choose between the two.

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