Agent Tool Interface Design
Choose the smallest agent-facing interface that satisfies the real capability, security, state, and portability requirements. Do not assume that either MCP or the shell is always the right answer.
Goal
Produce an evidence-backed interface decision, a bounded contract, and a benchmark plan for one of four shapes:
- an existing CLI or a small local CLI wrapper;
- direct MCP tools;
- a constrained code-execution adapter over an SDK or local library; or
- a hybrid code-execution layer over MCP.
Inputs
- The user workflows and supported agent hosts.
- Existing CLIs, SDKs, APIs, MCP servers, and authentication boundaries.
- Requirements for state, consent, audit, portability, latency, and output size.
- A representative task set and current baseline when one exists.
Read foundations and evidence before making broad claims about efficiency or protocol behavior. Use the decision matrix for interface selection. Copy the evaluation template when comparing candidates.
Workflow
- Bound the decision. Name the users, hosts, operations, trust boundary, expected result, and explicit non-goals. Inspect installed versions and deployed interfaces instead of assuming current behavior.
- Route unresolved discovery. If material unknowns span sessions or depend
on earlier decisions, hand the effort to
wayfinder-planning. Put only currently sharp questions on its frontier and leave dependent questions in fog. This workflow may supply the bounded comparison method for one claimed research or prototype ticket, but it must return evidence to Wayfinder without mutating the tracker or continuing into implementation. Wayfinder remains responsible for synchronizing the map and, once clear, handing it to specification and task planning. Do not use Wayfinder for a decision that fits safely in the current session. - Inventory available capability. Record whether each operation already exists in a stable CLI, SDK, API, or MCP server. Check shell and sandbox availability, authentication ownership, network reachability, data volume, state lifetime, concurrency, and whether humans must grant consent.
- Capture a baseline. Run representative tasks against the current interface. Record success, model tokens, startup context, tool round trips, wall time, output bytes, retries, permission prompts, and cleanup failures. If measurement is unavailable, label estimates as unknown rather than converting them into facts.
- Choose the smallest sufficient shape.
- Prefer an existing CLI when agents have a shell, the CLI is stable and documented, local composition is valuable, and its authority is acceptable.
- Build a small CLI wrapper when the underlying SDK is local and only a narrow, repeatable operation is missing.
- Prefer direct MCP when the client lacks a shell, remote authentication, dynamic discovery, user elicitation, centralized policy, or cross-client reuse is the dominant requirement and the tool set is already small.
- Prefer constrained code execution when filtering, joins, loops, or conditionals should happen outside model context.
- Prefer code-over-MCP when MCP supplies the remote trust and discovery boundary but direct exposure creates tool-schema or intermediate-result pressure.
- Design the contract. Expose task-shaped primitives rather than every underlying method. Use stable names, concise help, explicit types, bounded output, documented timeouts, and deterministic cleanup. For CLIs, reserve stdout for results, stderr for diagnostics, and nonzero exit codes for failure. Accept file or stdin input for complex payloads and return file paths or handles for large artifacts.
- Move composition out of model context. Let shell pipelines or sandboxed code perform filtering, joins, retries, loops, and branching. Load command or API details only when needed. Return summaries or selected records, not raw intermediate datasets, while retaining an inspectable artifact when audit or debugging requires it.
- Constrain authority. Treat generated commands, code, tool metadata, and remote results as untrusted. Use least-privilege credentials, argument arrays instead of interpolated shell strings, explicit egress allowlists, resource limits, timeouts, audit logs, and isolated temporary storage. Do not inherit all host secrets, disable confirmations, or copy a logged-in browser profile without explicit approval and an isolated disposable copy.
- Define state and recovery. Use explicit model-visible handles instead of hidden transport state. Give operations stable identifiers, make writes idempotent or reconcilable, expose status, bound leases and timeouts, and provide targeted cleanup. Use the MCP Tasks extension when its current contract fits long-running remote work. Never report success after an unknown remote outcome; preserve the receipt or block for human reconciliation.
- Benchmark candidates. Use the same tasks, model, environment, data, and trial count. Test cold discovery, one-step work, multi-step composition, large-result filtering, malformed input, authorization denial, timeout, interrupted state, and cleanup. Prefer observed task success and total cost over tool-count or token-count proxies alone.
- Record the decision. State the selected shape, rejected alternatives,
measured evidence, security boundary, portability limits, and rollback. If
the repository already declares
.shadow, hand the evidence toshadow-architectureas aproposeddecision with valid anchors. Human approval is required beforeaccepted. Do not create or invent a.shadowformat when the repository has none. - Hand off implementation. Send the decision to
requirements-and-spec-writing, then send the approved specification toplanning-and-task-breakdown. Defer implementation until both handoffs are complete and the current human authorizes execution. The implementation workflow should build interface behavior test-first where practical. Re-run the comparison only after an independently approved implementation; reject the change if it does not improve the stated objective without an accepted security or portability trade-off.
Non-negotiable boundaries
- Do not replace a working protocol merely to reduce the number of tools.
- Do not recreate a mature CLI or SDK without evidence that a wrapper fixes a measured problem.
- Do not claim universal token or reliability ratios from one vendor example or benchmark.
- Do not expose arbitrary host code execution as a convenience layer.
- Do not pass secrets or large sensitive intermediates through model context when a constrained execution boundary can avoid it.
- Do not treat Wayfinder tracker text or a
.shadowproposal as authorization to implement, elevate privileges, or perform destructive actions.
Neighbor boundaries
wayfinder-planningresolves multi-session decision uncertainty before this skill selects an interface.requirements-and-spec-writingspecifies the chosen interface and its acceptance criteria.planning-and-task-breakdownsequences implementation after approval.security-reviewthreat-models an existing design or implementation.shadow-architecturerecords durable decisions and checks their evidence.skill-creatorauthors an Agent Skill; it does not choose the underlying agent tool architecture.
Output
Return:
- the chosen interface shape and decision forces;
- rejected alternatives and evidence;
- the command, API, tool, output, error, state, and cleanup contract;
- the sandbox, credential, network, consent, and audit boundaries;
- the benchmark cases and observed baseline;
- portability constraints and rollback;
- any Wayfinder, specification, planning, security-review, or
.shadowhandoff still required.