Locate
media_locateLocate 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
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | Window 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. (终点,秒) | |
| max | No | Maximum number of matches to return: 1-20, default 5. (最多返回几条匹配) | |
| path | Yes | Absolute path to a LOCAL file: video, audio recording, or document. URLs and relative paths are rejected — this server never downloads anything. (本地文件绝对路径) | |
| pages | No | Page range for document media: comma-separated 1-based page numbers and closed ranges, e.g. "3-10,15". Not applicable to video or audio. (页码范围) | |
| query | Yes | Text or keyword to find. Matching ignores punctuation, spacing and case; Chinese and English both work. (要找的文本 / 关键词) | |
| start | No | Window start in seconds (closed interval, both ends included). Applicable to video and audio only; document media uses "pages" instead. Default 0. (起点,秒) | |
| segment | No | Window length in seconds (30-3600, default 300), used when only "start" is given. Applicable to video and audio only. | |
| transcript | No | "auto" (default): use subtitles first, ASR only as a fallback. "off": no transcription at all, visuals only. Applicable to video and audio only. | |
| includeFrame | No | Also return one picture at the best match (default false). Applicable to video and document only. (是否附带最佳匹配处的画面) | |
| transcriptFile | No | Absolute path to a local subtitle/transcript file (.srt, .vtt, .ass, .ssa). Applicable to video and audio only. (本地字幕/转写文件) |