Skip to main content
Glama
agent-bridge-mcp

agent-bridge-mcp

by sakerice

delegate_task

Asynchronously delegates tasks to another AI agent (Claude or Codex) and returns a job ID so you can track progress and retrieve results.

Instructions

タスクをもう一方のAIエージェント(claude/codex)に非同期で委譲する。即座にjob_idを返す。進捗はjob_status、結果はjob_resultで回収する。委譲先が画像・動画などのメディアを生成した場合はjob_status/job_resultのartifacts欄に列挙されるので、get_artifactでプレビューし、中間/最終成果物としてユーザーに提示すること。

モデル運用ポリシー(委譲前に必ず読むこと)

  • model未指定の委譲は各CLIの既定=最高位モデルで実行され、トークンコストが高い。

  • 委譲前に、このタスクがワーカー仕事(定型実装・変換・調査など)なら下位モデルで十分でないか検討し、どのモデルを使うかユーザーに確認してから委譲すること。ユーザーが既に指定済み、または過去に方針を明示している場合は再確認不要。

  • 下記ガイドのモデル名は必ず古くなる。ユーザーに確認するときは、候補を並べて選ばせるだけでなく「最新のモデルを使うか、ここに挙げた中から選ぶか」を問うこと。あなたの知る最新のラインナップとガイドに乖離があれば、その場で伝えてガイドの更新(~/.agent-bridge/model-guide.md)を提案すること。

  • **画像を作らせるときは model に画像生成モデルを指定しないこと。**gpt-image-2 のような画像モデルの直接指定は「not supported when using Codex with a ChatGPT account」で失敗する(繰り返し起きている失敗)。model は指定せず、プロンプトで「画像を作ってほしい」と依頼すれば委譲先が自分の画像生成の道具を使う。SVG を書いて変換させる代用は品質が低いので、プロンプトで明示的に禁じること。

モデル選定ガイド(2026-10-07時点。必ず古くなる)

原則: 高位モデルには高位の仕事(設計判断・高難度レビュー・オーケストレーション)を、 下位モデルにはワーカー仕事(定型実装・変換・調査)を割り当てる。

画像を作らせるときは model を指定しない(繰り返し起きている失敗)

画像生成モデル(gpt-image-2 など)を model に直接指定すると失敗する: The 'gpt-image-2' model is not supported when using Codex with a ChatGPT account.

model は指定せず(または通常のテキストモデルを指定し)、プロンプトで「画像を作ってほしい」と 依頼すること。委譲先が自分の画像生成の道具を使って描く。

SVG を書いて PNG に変換する代用は品質が低い。画像が要るならプロンプトに 「SVG やプログラムで図形を描くのは禁止。画像生成で描くこと」と明記する。

モデル名(2026-10-07時点。古くなっている前提で扱うこと)

仕事

codex

claude

設計判断・高難度レビュー

gpt-6-astra

claude-fable-5-1(重い) / claude-opus-5-5

通常の実装

gpt-6.1-sol(このマシンの既定)

claude-sonnet-5-5

定型・変換・調査

gpt-6-luna

claude-haiku-4-5 または claude-sonnet-5-5

  • codex の旧世代(gpt-6-sol, gpt-5.6-*)は使わない。gpt-image-2 は指定禁止(上記)。

  • claude のモデルIDに日付を付けない。claude への委譲は端末側の Claude Code がログイン済みである必要がある。

  • model未指定の場合、各CLIの既定で実行される(codex はこのマシンの ~/.codex/config.toml の model)。

実地で確かめる: ~/.codex/models_cache.json(codex が取り直す一覧)と cat ~/.codex/config.toml | head -5

使用量の上限

ChatGPT アカウントの codex には枠がある。上限に当たると即座に 「You've hit your usage limit ... try again at <時刻>」が返る。 その時刻は当てにならない(待って投げ直しても同じまま失敗することがある。実測)。 数回試して駄目なら深追いせず、ユーザーに報告して止めること。

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": {
      "target": "<target>",
      "prompt": "<prompt>",
      "cwd": "<cwd>"
    },
    "name": "delegate_task"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdYesタスクの作業ディレクトリ(絶対パス)
modeNotask(デフォルト)=通常の作業委譲。review=読み取り専用でのコードレビュー委譲(codex: read-onlyサンドボックス、claude: planモード)。レビュー依頼では必ずreviewを使うこと
modelNo使用モデルの上書き(任意)。**画像生成モデル(gpt-image-2 など)をここに指定しないこと**——ChatGPTアカウントのcodexでは拒否されて即失敗する。画像が欲しいときは model を指定せず、prompt で画像生成を依頼する
promptYes委譲するタスクの指示文
targetYes委譲先エージェント
follow_up_ofNo前回の委譲ジョブのjob_idを指定すると、同じワーカーセッションを再開して文脈を保ったまま追撃依頼できる(同一targetのみ)
timeout_minutesNoタイムアウト(分)。デフォルト30。上限10080分(7日)。これを超えると内部のsetTimeout遅延がInt32範囲(約24.8日)をオーバーフローし、意図せず即time_outする恐れがあるため上限を設けている

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

No annotations are provided, so the description has to carry the full behavioral burden, and it does: it states the call is asynchronous and returns immediately, that artifacts surface in job_status/job_result, that model-unspecified delegations run on the most expensive default, and that usage-limit errors may be unreliable. It also documents the timeout ceiling with a concrete failure mechanism (Int32 overflow in setTimeout).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core purpose is front-loaded in the first sentence, which is good. But the definition then repeats the gpt-image-2 failure warning three or four times, duplicates the model table both as prose and as a table, and includes a lengthy stale-model caveat that inflates length far beyond what is needed to call the tool. Every sentence does not earn its place.

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 seven-parameter asynchronous tool with no annotations and no output schema, the definition covers the lifecycle, artifact handling, timeout limits, session resumption via follow_up_of, and cost implications. What is missing is the shape of the return value: it says a job_id is returned immediately, but not the format or what a job_status payload looks like. With no output schema, that gap could be closed here.

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 coverage is 100%, so the schema already documents all seven parameters, including the enum values for target and mode and the image-generation-model warning for model. The model-tier policy table adds real decision context for the model parameter, but the description says nothing extra about cwd, prompt, target, or follow_up_of. This is the expected baseline when the schema does the heavy lifting.

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?

The opening sentence uses a concrete verb (delegate asynchronously) with a concrete target (another AI agent: claude/codex) and states the immediate return (job_id). It then names the exact siblings in the lifecycle chain, job_status, job_result, and get_artifact, so the agent can distinguish this tool from them without opening any schema.

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?

The definition gives explicit routing: poll job_status for progress, collect results with job_result, and use get_artifact to preview media artifacts. It also states the preconditions for delegation (confirm the model tier with the user unless already specified, and use mode=review for review tasks), which are exactly the decisions an agent must make before calling this tool.

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