SDL-MCP Agent Workflow
Use SDL-MCP as the repository boundary.
When a client bridge returns the raw MCP result, prefer structuredContent; use
text content only as a fallback for older servers. Do not emit both or return
the whole MCP response envelope to the agent.
Omit detail and includeDiagnostics by default at workflow and step level. Use detail: "full" only for specific fields missing from compact output; enable includeDiagnostics: true only to investigate operational data, then remove it after that probe. For command evidence, select outputMode (minimal for success/failure, summary for captured command output, digest for noisy checks) or follow the returned output continuation; do not enable diagnostics to reveal stdout.
- Start with
repo.status.
- Use
sdl.context for task-shaped explain, debug, review, and implement work.
Its request is flat and requires budget.maxTokens; never send options,
contextMode, or answerFirst.
- Use
sdl.retrieve for one card, slice, skeleton, hot path, or justified code
window. When structured retrieval is unavailable, use a targeted, bounded sdl.file { op: "read" } fallback.
- Use
sdl.workflow for runtime execution, transforms, dependent calls, and
batch mutations. Persist command output and query only needed failure lines.
runtimeExecute executes repository tooling. Permitted uses include build,
test, lint, compiler, named scripts, and targeted edit scripts. Do not use it
to inspect, search, or print repository files. Use sdl.context or sdl.retrieve
for indexed source and sdl.file with op="read" for other files. Do not guess
runtimeQueryOutput arguments; replay a returned action unchanged or call
focused sdl.manual for runtime.queryOutput first.
- Read non-indexed files through
sdl.file; use the same targeted, bounded read only when structured retrieval is unavailable for indexed source. Its targeted write operation can
update one indexed file with live reconciliation; prefer symbol or
search-edit preview/apply operations when they can anchor the change.
- Keep
responseMode: "auto" for potentially large results. When a result
returns a canonical response.get continuation (nextAction or action) for
sdl.retrieve with op: "responseGet", replay its returned action and
arguments unchanged; do not reconstruct it.
Outer repoId owns trusted dispatch, and detail/includeDiagnostics stay
outer sdl.retrieve controls. Nested args contains only artifact view and
paging fields; nested repoId is invalid. Use workflow responseGet only
when direct sdl.retrieve is unavailable or an existing multi-step workflow
needs it.
- Reuse refs and ETags. Set
refsMode: "off" only for complete or byte-stable
output.
- Never call
index.refresh, directly, through sdl.workflow, or via
sdl-mcp index, without explicit user approval in the current turn. Dirty
semantic flags, graph verification, parser-state/provenance warnings, and
refresh recommendations are diagnostics, not approval. Do not wait for
semantic freshness or verification unless the task requires latest-revision
graph proof. Use an SDL file-based edit fallback after provenance failures.
- Call usage statistics only when the user asks for token savings or telemetry.
Use tool recipes for exact v2 request shapes.
1---2name: sdl-mcp-agent-workflow3description: Use when working in an SDL-MCP-enabled repository, including repository exploration, task context, code inspection, runtime execution, edits, or SDL-MCP tool calls.4---56# SDL-MCP Agent Workflow78Use SDL-MCP as the repository boundary.910When a client bridge returns the raw MCP result, prefer `structuredContent`; use11text `content` only as a fallback for older servers. Do not emit both or return12the whole MCP response envelope to the agent.1314Omit `detail` and `includeDiagnostics` by default at workflow and step level. Use `detail: "full"` only for specific fields missing from compact output; enable `includeDiagnostics: true` only to investigate operational data, then remove it after that probe. For command evidence, select `outputMode` (`minimal` for success/failure, `summary` for captured command output, `digest` for noisy checks) or follow the returned output continuation; do not enable diagnostics to reveal stdout.15161. Start with `repo.status`.172. Use `sdl.context` for task-shaped explain, debug, review, and implement work.18 Its request is flat and requires `budget.maxTokens`; never send `options`,19 `contextMode`, or `answerFirst`.203. Use `sdl.retrieve` for one card, slice, skeleton, hot path, or justified code21 window. When structured retrieval is unavailable, use a targeted, bounded `sdl.file { op: "read" }` fallback.224. Use `sdl.workflow` for runtime execution, transforms, dependent calls, and23 batch mutations. Persist command output and query only needed failure lines.24 runtimeExecute executes repository tooling. Permitted uses include build,25 test, lint, compiler, named scripts, and targeted edit scripts. Do not use it26 to inspect, search, or print repository files. Use sdl.context or sdl.retrieve27 for indexed source and sdl.file with op="read" for other files. Do not guess28 `runtimeQueryOutput` arguments; replay a returned action unchanged or call29 focused `sdl.manual` for `runtime.queryOutput` first.305. Read non-indexed files through `sdl.file`; use the same targeted, bounded read only when structured retrieval is unavailable for indexed source. Its targeted write operation can31 update one indexed file with live reconciliation; prefer symbol or32 search-edit preview/apply operations when they can anchor the change.336. Keep `responseMode: "auto"` for potentially large results. When a result34 returns a canonical `response.get` continuation (`nextAction` or `action`) for35 `sdl.retrieve` with `op: "responseGet"`, replay its returned action and36 arguments unchanged; do not reconstruct it.37 Outer `repoId` owns trusted dispatch, and `detail`/`includeDiagnostics` stay38 outer `sdl.retrieve` controls. Nested `args` contains only artifact view and39 paging fields; nested `repoId` is invalid. Use workflow `responseGet` only40 when direct `sdl.retrieve` is unavailable or an existing multi-step workflow41 needs it.427. Reuse refs and ETags. Set `refsMode: "off"` only for complete or byte-stable43 output.448. Never call `index.refresh`, directly, through `sdl.workflow`, or via45 `sdl-mcp index`, without explicit user approval in the current turn. Dirty46 semantic flags, graph verification, parser-state/provenance warnings, and47 refresh recommendations are diagnostics, not approval. Do not wait for48 semantic freshness or verification unless the task requires latest-revision49 graph proof. Use an SDL file-based edit fallback after provenance failures.509. Call usage statistics only when the user asks for token savings or telemetry.5152Use [tool recipes](./references/tool-recipes.md) for exact v2 request shapes.