{"record":{"id":"1080c7277630c032","repo":"calesthio/OpenMontage","slug":"get-requires-clip-id","errorCode":null,"errorMessage":"get requires 'clip_id'","messagePattern":"get requires 'clip_id'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/video/clip_search.py","lineNumber":351,"sourceCode":"        raise ValueError(\"diversify requires 'candidate_ids'\")\n\n    kept = corp.diversify(\n        candidate_ids=list(candidate_ids),\n        n=int(inputs.get(\"n\", 5)),\n        diversity=float(inputs.get(\"diversity\", 0.5)),\n    )\n    return {\n        \"input_count\": len(candidate_ids),\n        \"kept_count\": len(kept),\n        \"kept_ids\": kept,\n    }\n\n\ndef _op_get(corp, inputs: dict[str, Any]) -> dict[str, Any]:\n    \"\"\"Look up one clip_id and return its full record.\"\"\"\n    clip_id = inputs.get(\"clip_id\")\n    if not clip_id:\n        raise ValueError(\"get requires 'clip_id'\")\n\n    rec = corp.get(clip_id)\n    if rec is None:\n        return {\"clip_id\": clip_id, \"found\": False, \"record\": None}\n    return {\"clip_id\": clip_id, \"found\": True, \"record\": asdict(rec)}\n","sourceCodeStart":333,"sourceCodeEnd":357,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/video/clip_search.py#L333-L357","documentation":"Raised by _op_get when inputs['clip_id'] is missing or falsy. This is the single-record lookup operation; unlike the others it does not validate existence — a nonexistent but present id returns {'found': False} rather than raising.","triggerScenarios":"Calling operation='get' with no arguments; passing the id under 'seed_clip_id' or 'id'; an id variable that is None after a failed extraction from another result.","commonSituations":"Key-name drift when chaining ops (rank uses query_text, find_similar uses seed_clip_id, get uses clip_id); agent tool calls omitting the argument; destructuring a record and grabbing a wrong field name.","solutions":["Pass clip_id explicitly, e.g. the record's id from a prior rank/find_similar result","Check the 'found' flag in the response rather than expecting an error for unknown ids","Standardize your pipeline on one key name and map at the boundary"],"exampleFix":"# before\nresult = clip_search.run(inputs={'operation':'get'})\n\n# after\nresult = clip_search.run(inputs={'operation':'get','clip_id':'clip_000123'})","handlingStrategy":"validation","validationCode":"clip_id = inputs.get('clip_id')\nif not clip_id:\n    raise ValueError('clip_id required for get')\ninputs['clip_id'] = clip_id","typeGuard":"def valid_get_inputs(inputs: dict) -> bool:\n    return bool(inputs.get('clip_id'))","tryCatchPattern":"try:\n    result = clip_search.run(inputs=inputs)\nexcept ValueError as e:\n    if \"get requires\" in str(e):\n        raise SystemExit('pass a clip_id to look up') from e\n    raise","preventionTips":["Standardize one id key across your pipeline and map per-op at the boundary","Use the returned found flag instead of exceptions for unknown ids","Destructure prior results with explicit field checks, not blind indexing"],"tags":["clip-search","validation","retrieval"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}