Skip to main content
Glama

Sync offset

media.correlate
Idempotent

Find how far one recording sits from another: the sync offset of b against a, by cross-correlating their sound, with how strongly they match. Use it to line up a camera with a separate microphone, two cameras of the same moment, or a re-recorded line against the original. Each side is imported media or an edit's mix (timeline_id), over its own from_seconds to until_seconds, so you can match a short stretch of b against a longer stretch of a. offset_seconds: b's moment t lines up with a's moment t + offset_seconds, each in its own seconds. To line them up on a timeline, place b's clip so it starts offset_seconds later than a's (earlier when negative), source starts being equal. strength is the correlation of the overlapping sound at that offset, -1 to 1: near 1 the same sound, near 0 unrelated; next_best is the best offset outside the winning peak, and a strength close to it means the match is unclear (repetitive sound, or not the same moment). Offsets are searched up to max_offset_seconds either way, where at least half of the shorter sound overlaps the other. Up to 600 s read from each side. A side with no sound in its range (no audio stream, a range past its end, or digital silence) fails with no_audio, naming which side. Short reads answer at once; longer ones return a task or job.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "a": "<a>",
      "b": "<b>",
      "max_offset_seconds": "<max_offset_seconds>"
    },
    "name": "media.correlate"
  }
}

Input Schema

NameRequiredDescriptionDefault
aYesThe sound to line up against: the reference
bYesThe sound whose offset you want
idempotency_keyNo
max_offset_secondsYesSearch offsets up to this far either way

Output Schema

NameRequiredDescriptionDefault
hintYes
job_idYesJob handle; the same value is the MCP task id
resultNoThe result, when status is completed; otherwise job.get gives it once completed
statusYes
media_idNoThe media it is making: an import is usable in edits once its status is processing, a created media once this job completes
status_uriYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • removedOutput schema / anyOf
      Removed value: -[
      -  {
      -    "properties": {
      -      "next_best": {
      -        "anyOf": [
      -          {
      -            "properties": {
      -              "offset_seconds": {
      -                "type": "number"
      -              },
      -              "strength": {
      -                "type": "number"
      -              }
      -            },
      -            "required": [
      -              "offset_seconds",
      -              "strength"
      -            ],
      -            "type": "object"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "description": "The best offset outside the winning peak: close to strength means an unclear match"
      -      },
      -      "offset_seconds": {
      -        "description": "b's moment t lines up with a's moment t + offset_seconds, each in its own seconds; null when the sounds can't overlap by half within max_offset_seconds",
      -        "type": [
      -          "number",
      -          "null"
      -        ]
      -      },
      -      "overlap_seconds": {
      -        "description": "How much sound overlaps at that offset",
      -        "type": [
      -          "number",
      -          "null"
      -        ]
      -      },
      -      "placement": {
      -        "description": "offset_seconds as where to place b on a timeline, in plain words. Trust it only once strength and next_best agree: two unrelated files still come back with a placement",
      -        "type": [
      -          "string",
      -          "null"
      -        ]
      -      },
      -      "strength": {
      -        "description": "Correlation of the overlapping sound at that offset, -1 to 1: near 1 the same sound, near 0 unrelated",
      -        "type": [
      -          "number",
      -          "null"
      -        ]
      -      }
      -    },
      -    "required": [
      -      "offset_seconds",
      -      "strength",
      -      "overlap_seconds",
      -      "next_best"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "hint": {
      -        "type": "string"
      -      },
      -      "job_id": {
      -        "description": "Job handle; the same value is the MCP task id",
      -        "pattern": "^j_[0-9a-z]{26}$",
      -        "type": "string"
      -      },
      -      "media_id": {
      -        "description": "The media it is making: an import is usable in edits once its status is processing, a created media once this job completes",
      -        "pattern": "^m_[0-9a-z]{26}$",
      -        "type": "string"
      -      },
      -      "status": {
      -        "enum": [
      -          "working",
      -          "completed",
      -          "failed",
      -          "cancelled"
      -        ],
      -        "type": "string"
      -      },
      -      "status_uri": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "job_id",
      -      "status",
      -      "status_uri",
      -      "hint"
      -    ],
      -    "type": "object"
      -  }
      -]
    • addedOutput schema / properties
      Added value: +{
      +  "hint": {
      +    "type": "string"
      +  },
      +  "job_id": {
      +    "description": "Job handle; the same value is the MCP task id",
      +    "pattern": "^j_[0-9a-z]{26}$",
      +    "type": "string"
      +  },
      +  "media_id": {
      +    "description": "The media it is making: an import is usable in edits once its status is processing, a created media once this job completes",
      +    "pattern": "^m_[0-9a-z]{26}$",
      +    "type": "string"
      +  },
      +  "result": {
      +    "description": "The result, when status is completed; otherwise job.get gives it once completed",
      +    "properties": {
      +      "next_best": {
      +        "anyOf": [
      +          {
      +            "properties": {
      +              "offset_seconds": {
      +                "type": "number"
      +              },
      +              "strength": {
      +                "type": "number"
      +              }
      +            },
      +            "required": [
      +              "offset_seconds",
      +              "strength"
      +            ],
      +            "type": "object"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "description": "The best offset outside the winning peak: close to strength means an unclear match"
      +      },
      +      "offset_seconds": {
      +        "description": "b's moment t lines up with a's moment t + offset_seconds, each in its own seconds; null when the sounds can't overlap by half within max_offset_seconds",
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      },
      +      "overlap_seconds": {
      +        "description": "How much sound overlaps at that offset",
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      },
      +      "placement": {
      +        "description": "offset_seconds as where to place b on a timeline, in plain words. Trust it only once strength and next_best agree: two unrelated files still come back with a placement",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "strength": {
      +        "description": "Correlation of the overlapping sound at that offset, -1 to 1: near 1 the same sound, near 0 unrelated",
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      }
      +    },
      +    "required": [
      +      "offset_seconds",
      +      "strength",
      +      "overlap_seconds",
      +      "next_best"
      +    ],
      +    "type": "object"
      +  },
      +  "status": {
      +    "enum": [
      +      "working",
      +      "completed",
      +      "failed",
      +      "cancelled"
      +    ],
      +    "type": "string"
      +  },
      +  "status_uri": {
      +    "type": "string"
      +  }
      +}
    • addedOutput schema / required
      Added value: +[
      +  "job_id",
      +  "status",
      +  "status_uri",
      +  "hint"
      +]
  2. Changed1 schema field changed
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "properties": {
      -      "next_best": {
      -        "anyOf": [
      -          {
      -            "properties": {
      -              "offset_seconds": {
      -                "type": "number"
      -              },
      -              "strength": {
      -                "type": "number"
      -              }
      -            },
      -            "required": [
      -              "offset_seconds",
      -              "strength"
      -            ],
      -            "type": "object"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "description": "The best offset outside the winning peak: close to strength means an unclear match"
      -      },
      -      "offset_seconds": {
      -        "description": "b's moment t lines up with a's moment t + offset_seconds, each in its own seconds; null when the sounds can't overlap by half within max_offset_seconds",
      -        "type": [
      -          "number",
      -          "null"
      -        ]
      -      },
      -      "overlap_seconds": {
      -        "description": "How much sound overlaps at that offset",
      -        "type": [
      -          "number",
      -          "null"
      -        ]
      -      },
      -      "placement": {
      -        "description": "offset_seconds as where to place b on a timeline, in plain words. Trust it only once strength and next_best agree: two unrelated files still come back with a placement",
      -        "type": [
      -          "string",
      -          "null"
      -        ]
      -      },
      -      "strength": {
      -        "description": "Correlation of the overlapping sound at that offset, -1 to 1: near 1 the same sound, near 0 unrelated",
      -        "type": [
      -          "number",
      -          "null"
      -        ]
      -      }
      -    },
      -    "required": [
      -      "offset_seconds",
      -      "strength",
      -      "overlap_seconds",
      -      "next_best"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "hint": {
      -        "type": "string"
      -      },
      -      "job_id": {
      -        "description": "Job handle; the same value is the MCP task id",
      -        "pattern": "^j_[0-9a-z]{26}$",
      -        "type": "string"
      -      },
      -      "media_id": {
      -        "description": "The media it is making; usable in edits once processing",
      -        "pattern": "^m_[0-9a-z]{26}$",
      -        "type": "string"
      -      },
      -      "status": {
      -        "enum": [
      -          "working",
      -          "completed",
      -          "failed",
      -          "cancelled"
      -        ],
      -        "type": "string"
      -      },
      -      "status_uri": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "job_id",
      -      "status",
      -      "status_uri",
      -      "hint"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "properties": {
      +      "next_best": {
      +        "anyOf": [
      +          {
      +            "properties": {
      +              "offset_seconds": {
      +                "type": "number"
      +              },
      +              "strength": {
      +                "type": "number"
      +              }
      +            },
      +            "required": [
      +              "offset_seconds",
      +              "strength"
      +            ],
      +            "type": "object"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "description": "The best offset outside the winning peak: close to strength means an unclear match"
      +      },
      +      "offset_seconds": {
      +        "description": "b's moment t lines up with a's moment t + offset_seconds, each in its own seconds; null when the sounds can't overlap by half within max_offset_seconds",
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      },
      +      "overlap_seconds": {
      +        "description": "How much sound overlaps at that offset",
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      },
      +      "placement": {
      +        "description": "offset_seconds as where to place b on a timeline, in plain words. Trust it only once strength and next_best agree: two unrelated files still come back with a placement",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "strength": {
      +        "description": "Correlation of the overlapping sound at that offset, -1 to 1: near 1 the same sound, near 0 unrelated",
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      }
      +    },
      +    "required": [
      +      "offset_seconds",
      +      "strength",
      +      "overlap_seconds",
      +      "next_best"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "hint": {
      +        "type": "string"
      +      },
      +      "job_id": {
      +        "description": "Job handle; the same value is the MCP task id",
      +        "pattern": "^j_[0-9a-z]{26}$",
      +        "type": "string"
      +      },
      +      "media_id": {
      +        "description": "The media it is making: an import is usable in edits once its status is processing, a created media once this job completes",
      +        "pattern": "^m_[0-9a-z]{26}$",
      +        "type": "string"
      +      },
      +      "status": {
      +        "enum": [
      +          "working",
      +          "completed",
      +          "failed",
      +          "cancelled"
      +        ],
      +        "type": "string"
      +      },
      +      "status_uri": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "job_id",
      +      "status",
      +      "status_uri",
      +      "hint"
      +    ],
      +    "type": "object"
      +  }
      +]
  3. Changed1 schema field changed
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "properties": {
      -      "next_best": {
      -        "anyOf": [
      -          {
      -            "properties": {
      -              "offset_seconds": {
      -                "type": "number"
      -              },
      -              "strength": {
      -                "type": "number"
      -              }
      -            },
      -            "required": [
      -              "offset_seconds",
      -              "strength"
      -            ],
      -            "type": "object"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "description": "The best offset outside the winning peak: close to strength means an unclear match"
      -      },
      -      "offset_seconds": {
      -        "description": "b's moment t lines up with a's moment t + offset_seconds, each in its own seconds; null when the sounds can't overlap by half within max_offset_seconds",
      -        "type": [
      -          "number",
      -          "null"
      -        ]
      -      },
      -      "overlap_seconds": {
      -        "description": "How much sound overlaps at that offset",
      -        "type": [
      -          "number",
      -          "null"
      -        ]
      -      },
      -      "placement": {
      -        "description": "offset_seconds as where to place b on a timeline, in plain words",
      -        "type": [
      -          "string",
      -          "null"
      -        ]
      -      },
      -      "strength": {
      -        "description": "Correlation of the overlapping sound at that offset, -1 to 1: near 1 the same sound, near 0 unrelated",
      -        "type": [
      -          "number",
      -          "null"
      -        ]
      -      }
      -    },
      -    "required": [
      -      "offset_seconds",
      -      "strength",
      -      "overlap_seconds",
      -      "next_best"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "hint": {
      -        "type": "string"
      -      },
      -      "job_id": {
      -        "description": "Job handle; the same value is the MCP task id",
      -        "pattern": "^j_[0-9a-z]{26}$",
      -        "type": "string"
      -      },
      -      "media_id": {
      -        "description": "The media it is making; usable in edits once processing",
      -        "pattern": "^m_[0-9a-z]{26}$",
      -        "type": "string"
      -      },
      -      "status": {
      -        "enum": [
      -          "working",
      -          "completed",
      -          "failed",
      -          "cancelled"
      -        ],
      -        "type": "string"
      -      },
      -      "status_uri": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "job_id",
      -      "status",
      -      "status_uri",
      -      "hint"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "properties": {
      +      "next_best": {
      +        "anyOf": [
      +          {
      +            "properties": {
      +              "offset_seconds": {
      +                "type": "number"
      +              },
      +              "strength": {
      +                "type": "number"
      +              }
      +            },
      +            "required": [
      +              "offset_seconds",
      +              "strength"
      +            ],
      +            "type": "object"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "description": "The best offset outside the winning peak: close to strength means an unclear match"
      +      },
      +      "offset_seconds": {
      +        "description": "b's moment t lines up with a's moment t + offset_seconds, each in its own seconds; null when the sounds can't overlap by half within max_offset_seconds",
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      },
      +      "overlap_seconds": {
      +        "description": "How much sound overlaps at that offset",
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      },
      +      "placement": {
      +        "description": "offset_seconds as where to place b on a timeline, in plain words. Trust it only once strength and next_best agree: two unrelated files still come back with a placement",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "strength": {
      +        "description": "Correlation of the overlapping sound at that offset, -1 to 1: near 1 the same sound, near 0 unrelated",
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      }
      +    },
      +    "required": [
      +      "offset_seconds",
      +      "strength",
      +      "overlap_seconds",
      +      "next_best"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "hint": {
      +        "type": "string"
      +      },
      +      "job_id": {
      +        "description": "Job handle; the same value is the MCP task id",
      +        "pattern": "^j_[0-9a-z]{26}$",
      +        "type": "string"
      +      },
      +      "media_id": {
      +        "description": "The media it is making; usable in edits once processing",
      +        "pattern": "^m_[0-9a-z]{26}$",
      +        "type": "string"
      +      },
      +      "status": {
      +        "enum": [
      +          "working",
      +          "completed",
      +          "failed",
      +          "cancelled"
      +        ],
      +        "type": "string"
      +      },
      +      "status_uri": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "job_id",
      +      "status",
      +      "status_uri",
      +      "hint"
      +    ],
      +    "type": "object"
      +  }
      +]
  4. Changed1 schema field changed
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "properties": {
      -      "next_best": {
      -        "anyOf": [
      -          {
      -            "properties": {
      -              "offset_seconds": {
      -                "type": "number"
      -              },
      -              "strength": {
      -                "type": "number"
      -              }
      -            },
      -            "required": [
      -              "offset_seconds",
      -              "strength"
      -            ],
      -            "type": "object"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "description": "The best offset outside the winning peak: close to strength means an unclear match"
      -      },
      -      "offset_seconds": {
      -        "description": "b's moment t lines up with a's moment t + offset_seconds, each in its own seconds; null when the sounds can't overlap by half within max_offset_seconds",
      -        "type": [
      -          "number",
      -          "null"
      -        ]
      -      },
      -      "overlap_seconds": {
      -        "description": "How much sound overlaps at that offset",
      -        "type": [
      -          "number",
      -          "null"
      -        ]
      -      },
      -      "strength": {
      -        "description": "Correlation of the overlapping sound at that offset, -1 to 1: near 1 the same sound, near 0 unrelated",
      -        "type": [
      -          "number",
      -          "null"
      -        ]
      -      }
      -    },
      -    "required": [
      -      "offset_seconds",
      -      "strength",
      -      "overlap_seconds",
      -      "next_best"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "hint": {
      -        "type": "string"
      -      },
      -      "job_id": {
      -        "description": "Job handle; the same value is the MCP task id",
      -        "pattern": "^j_[0-9a-z]{26}$",
      -        "type": "string"
      -      },
      -      "media_id": {
      -        "description": "The media it is making; usable in edits once processing",
      -        "pattern": "^m_[0-9a-z]{26}$",
      -        "type": "string"
      -      },
      -      "status": {
      -        "enum": [
      -          "working",
      -          "completed",
      -          "failed",
      -          "cancelled"
      -        ],
      -        "type": "string"
      -      },
      -      "status_uri": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "job_id",
      -      "status",
      -      "status_uri",
      -      "hint"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "properties": {
      +      "next_best": {
      +        "anyOf": [
      +          {
      +            "properties": {
      +              "offset_seconds": {
      +                "type": "number"
      +              },
      +              "strength": {
      +                "type": "number"
      +              }
      +            },
      +            "required": [
      +              "offset_seconds",
      +              "strength"
      +            ],
      +            "type": "object"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "description": "The best offset outside the winning peak: close to strength means an unclear match"
      +      },
      +      "offset_seconds": {
      +        "description": "b's moment t lines up with a's moment t + offset_seconds, each in its own seconds; null when the sounds can't overlap by half within max_offset_seconds",
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      },
      +      "overlap_seconds": {
      +        "description": "How much sound overlaps at that offset",
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      },
      +      "placement": {
      +        "description": "offset_seconds as where to place b on a timeline, in plain words",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "strength": {
      +        "description": "Correlation of the overlapping sound at that offset, -1 to 1: near 1 the same sound, near 0 unrelated",
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      }
      +    },
      +    "required": [
      +      "offset_seconds",
      +      "strength",
      +      "overlap_seconds",
      +      "next_best"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "hint": {
      +        "type": "string"
      +      },
      +      "job_id": {
      +        "description": "Job handle; the same value is the MCP task id",
      +        "pattern": "^j_[0-9a-z]{26}$",
      +        "type": "string"
      +      },
      +      "media_id": {
      +        "description": "The media it is making; usable in edits once processing",
      +        "pattern": "^m_[0-9a-z]{26}$",
      +        "type": "string"
      +      },
      +      "status": {
      +        "enum": [
      +          "working",
      +          "completed",
      +          "failed",
      +          "cancelled"
      +        ],
      +        "type": "string"
      +      },
      +      "status_uri": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "job_id",
      +      "status",
      +      "status_uri",
      +      "hint"
      +    ],
      +    "type": "object"
      +  }
      +]
  5. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations: explains the offset sign convention, what strength and next_best mean (including how to detect an ambiguous match), that searches stop when half the shorter sound no longer overlaps, the 600 s per-side read cap, the no_audio failure mode with side naming, and that long reads return a task/job. This is exactly the behavioral context annotations don't carry.

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 the core verb and result, then progresses logically through inputs, output semantics, constraints, and error/async behavior. It is dense but nearly every sentence carries information; the timeline-placement aside is the only mildly expendable part.

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?

For a nested-input, computed-output tool this covers the sign convention, match quality, search bounds, size limits, failure mode, and async behavior. An output schema exists, yet the description's explanation of offset_seconds/strength/next_best adds clarity rather than redundancy.

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 75%, and the description adds real meaning: a is the reference, b is the sound whose offset is sought, each side is media or a timeline mix read over its own from_seconds/until_seconds, and max_offset_seconds is bounded by the requirement that at least half the shorter sound overlaps. idempotency_key is left unexplained, and from/until are covered by the schema.

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 operation (cross-correlating sound to find sync offset of b against a) plus the strength of the match. It is immediately distinguishable from siblings like media.analyze or media.listen, which don't compute offsets between two sources.

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 three concrete use cases (camera vs. separate mic, two cameras of the same moment, re-recorded line vs. original), which is strong context for selecting this tool. It doesn't explicitly say when NOT to use it or name an alternative tool, so it falls short of a 5.

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.