Skip to main content
Glama

Locate

media_locate
Read-only

Locate text or keywords in local video, audio, or documents to get exact timestamps or page numbers. Use when you know what was said but not when, or need to find which page a phrase is on.

Instructions

Find where something appears in a local media file and return its position: a timestamp (milliseconds and seconds) for a video or recording, a page number for a document. (定位:给一段文本或关键词,返回它在视频 / 录音里的时间戳,在文档里的页码。)

Use it when you know roughly what was said but not when ("where does it mention X"), or when you need to know which page a phrase is on. Matching ignores punctuation, spacing and case, and works for both Chinese and English. Long phrases match better than single characters.

Text only by default — no image, no pixels spent. Add includeFrame: true to also get the picture at the best match (one image, roughly 1,900 vision tokens).

A transcript is required: the embedded subtitle track, a transcriptFile you pass in, or ASR configured via MMGREP_ASR_PROVIDER. Subtitles win over ASR. If none is available this tool says so instead of guessing. Use media_overview if you only need the visuals.

Each match is tagged with its source. A match whose source is "asr" came from machine transcription, so the wording may be wrong (names, numbers, jargon) — do not present it as the speaker's exact words.

Input Schema

NameRequiredDescriptionDefault
endNoWindow end in seconds (closed interval, both ends included). Applicable to video and audio only. Defaults to the end of the media; a value past the end is clipped and reported. (终点,秒)
maxNoMaximum number of matches to return: 1-20, default 5. (最多返回几条匹配)
pathYesAbsolute path to a LOCAL file: video, audio recording, or document. URLs and relative paths are rejected — this server never downloads anything. (本地文件绝对路径)
pagesNoPage range for document media: comma-separated 1-based page numbers and closed ranges, e.g. "3-10,15". Not applicable to video or audio. (页码范围)
queryYesText or keyword to find. Matching ignores punctuation, spacing and case; Chinese and English both work. (要找的文本 / 关键词)
startNoWindow start in seconds (closed interval, both ends included). Applicable to video and audio only; document media uses "pages" instead. Default 0. (起点,秒)
segmentNoWindow length in seconds (30-3600, default 300), used when only "start" is given. Applicable to video and audio only.
transcriptNo"auto" (default): use subtitles first, ASR only as a fallback. "off": no transcription at all, visuals only. Applicable to video and audio only.
includeFrameNoAlso return one picture at the best match (default false). Applicable to video and document only. (是否附带最佳匹配处的画面)
transcriptFileNoAbsolute path to a local subtitle/transcript file (.srt, .vtt, .ass, .ssa). Applicable to video and audio only. (本地字幕/转写文件)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations only declare readOnlyHint and openWorldHint, so the description carries the rest: text-only by default, includeFrame costs roughly 1,900 vision tokens for one image, transcript precedence (subtitles > transcriptFile > ASR via MMGREP_ASR_PROVIDER), graceful failure rather than guessing, and the caveat that ASR-sourced matches may misquote names and numbers. The only missing piece is a fuller account of the per-match record fields.

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?

Front-loaded with purpose and return format, then usage, cost, and prerequisites in short paragraph blocks. It runs longer than most definitions, but nearly every sentence carries decision-relevant information (token cost, transcript requirement, ASR caveat); the bilingual restatements add length without adding much for an English-reading agent.

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 10-parameter tool with no output schema, the description covers the critical unknowns: what is returned (position units, source tag), what it costs, what prerequisites must hold, and how failure is surfaced. It stops short of enumerating all result fields (snippet text, match metadata), leaving some return-shape uncertainty.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3; the description adds genuine meaning on top — matching ignores punctuation, spacing and case, works in Chinese and English, and long phrases match better than single characters — which the schema's query field does not say. It also ties the transcript/transcriptFile parameters to the ASR fallback logic.

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 where a given text appears in a local media file — and specifies the return shape (timestamp in ms/seconds for video/audio, page number for documents). It also names the sibling it is not (media_overview for visuals only), so an agent can choose without opening schemas.

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?

Gives an explicit use case ("you know roughly what was said but not when") plus an explicit alternative ("Use media_overview if you only need the visuals"). It also warns when the tool cannot work (no transcript available), which is a real when-not condition.

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