Skip to main content
Glama

Get the marker nearest to a time

get_nearest_marker
Read-onlyIdempotent

Find the marker closest to a specified time or the playhead without moving it, optionally restricting the search to before or after, and return its offset and span status.

Instructions

Find the marker closest to a time (default: the playhead) without moving the playhead. direction limits the search to markers at or before / at or after that time. Returns found, marker, offset (marker time minus the time, in seconds) and inside_marker (the time lies within the marker's span). Use go_to_next_marker / go_to_previous_marker to move the playhead instead.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_nearest_marker"
  }
}

Input Schema

NameRequiredDescriptionDefault
textNoOnly markers whose name or comment contains this text (plain substring, case-insensitive).
timeNoTime to measure from, in seconds. Default: the playhead position.
typeNoOnly markers of this type. One of "comment", "chapter", "segmentation", "web_link".
colorNoOnly markers of this colour. Colour index or name: 0 green, 1 red, 2 purple, 3 orange, 4 yellow, 5 white, 6 blue, 7 cyan.
to_timeNoOnly markers that start at or before this sequence time, in seconds.
directionNo"nearest" (default), "before" (at or before the time) or "after" (at or after the time).
from_timeNoOnly markers that start at or after this sequence time, in seconds.
sequence_idNoStable sequence id (from list_sequences). Omit to use the active sequence.
sequence_nameNoSequence name; used only when sequence_id is not given.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered. The description adds genuinely new behavior: the search does not move the playhead and it discloses the returned fields including offset semantics (marker time minus the time) and inside_marker.

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 tight sentences, front-loaded with the core action and constraint, then return shape, then the sibling alternative. 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?

For a nine-parameter read tool with no output schema, the description still covers defaults, the primary filter semantics, the return structure, and the alternative tool. Minor gaps remain, such as tie-breaking between equidistant markers and what happens when found is false.

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 all nine parameters are already documented, including the direction enum and the default-to-playhead behavior for time. The description's restatement of direction ('at or before / at or after') largely duplicates the schema, so it sits at the high-coverage baseline rather than adding meaning.

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 ('Find the marker closest to a time'), names the default input (the playhead), and adds a key scope constraint ('without moving the playhead') that separates it from the go_to_* siblings.

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?

Explicitly routes the agent to go_to_next_marker / go_to_previous_marker when the goal is to move the playhead rather than query. It lacks an explicit pointer to get_marker for direct id lookup, but the when-to-use condition is clear.

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

Deploy Server

Other Tools