Goal
Expose Wright's existing structured agent capabilities as native coding-agent tools, so an agent can invoke semantic operations directly instead of routing every request through shell commands and JSON stdout.
The initial outcome is a reviewed architecture for this tool surface and a bounded implementation plan. Do not introduce a second semantic API: native tools must adapt the existing wright-agent/v1 / ToolService contract.
Context
Wright already has a stable structured agent backend:
ToolService is the executable operation layer.
wright-agent/v1 defines versioned requests and responses.
wright serve exposes the contract over newline-delimited JSON and JSON-RPC.
- Existing operations include semantic queries, lint/findings, cost, call graph, diagnostics, and validated edits.
Today a coding agent can use these capabilities through shell + JSON or by implementing a client for the session protocol. That still leaves an avoidable integration gap: harnesses that support native tools should be able to discover and invoke Wright operations directly as structured tool calls.
This is particularly relevant to the agent-efficiency work: semantic queries should replace unnecessary grep/search/read work, while source reads remain the final mile for judgment and modification.
Scope
- Define the native coding-agent tool surface over the existing Wright agent contract.
- Determine the appropriate transport/adapter boundary for common harnesses; MCP is a candidate, not a pre-decided architecture requirement.
- Define how tool discovery maps from
capabilities.operations.
- Define tool names, descriptions, input schemas, structured results, refusals/errors, and session/project lifecycle.
- Identify the smallest high-value initial tool set for agent workflows, with semantic navigation and validation prioritized over exhaustive exposure.
- Preserve the same operation semantics across CLI,
wright serve, embedding, and native-tool surfaces.
- Add verification that native-tool calls and direct
ToolService calls are behaviorally equivalent for exposed operations.
- Extend the agent benchmark so the native-tool condition can be compared with shell/JSON usage for task success and search/read/tool-call efficiency.
Design constraints
ToolService / wright-agent/v1 remain the semantic authority for Wright-owned agent operations.
- The adapter must not reimplement symbols, references, lint, cost, rename, provider behavior, or other language/tooling semantics.
- Do not add Wright-only source-language semantics to make a tool easier to expose.
- Do not require every
wright-agent/v1 operation to become a native tool in the first version.
- Prefer a thin adapter that can be removed or replaced without changing the underlying agent contract.
- Unsupported provider capabilities and semantic refusals must remain explicit; no textual or grep-based fallback belongs in the adapter.
Architecture questions
Resolve before implementation:
- Which transport should be the first native-tool integration: MCP, harness-specific adapters, or another thin mapping?
- Should Wright expose one generic request tool or multiple operation-specific tools? Evaluate tool discoverability, schema quality, model selection cost, and compatibility with the existing contract.
- Which operations form the minimum useful initial set for semantic navigation and validated work?
- How should project/session startup and lifetime map onto stateless-looking tool calls?
- How should capability negotiation hide unsupported tools or represent dynamic provider capabilities?
- What result shapes can be passed through unchanged, and where is a presentation-only wrapper justified?
- How should native-tool use be measured against shell + JSON in the existing agent benchmark?
Non-goals
- Designing a new agent framework, planner, or model runtime.
- Replacing
wright-agent/v1.
- Creating a parallel semantic contract specifically for MCP or one vendor.
- Reimplementing language semantics in the adapter.
- Exposing every existing operation before benchmark or workflow evidence shows it is useful.
- Changing OPY, DEL/OSTW, or Workshop ownership as part of this issue.
- Solving the broader provider/upstream architecture reevaluation in this task.
Acceptance criteria
Dependencies / ownership
This issue intentionally stops at the architecture boundary first. Implementation details should follow the approved design rather than being inferred from a preferred transport.
Goal
Expose Wright's existing structured agent capabilities as native coding-agent tools, so an agent can invoke semantic operations directly instead of routing every request through shell commands and JSON stdout.
The initial outcome is a reviewed architecture for this tool surface and a bounded implementation plan. Do not introduce a second semantic API: native tools must adapt the existing
wright-agent/v1/ToolServicecontract.Context
Wright already has a stable structured agent backend:
ToolServiceis the executable operation layer.wright-agent/v1defines versioned requests and responses.wright serveexposes the contract over newline-delimited JSON and JSON-RPC.Today a coding agent can use these capabilities through shell + JSON or by implementing a client for the session protocol. That still leaves an avoidable integration gap: harnesses that support native tools should be able to discover and invoke Wright operations directly as structured tool calls.
This is particularly relevant to the agent-efficiency work: semantic queries should replace unnecessary grep/search/read work, while source reads remain the final mile for judgment and modification.
Scope
capabilities.operations.wright serve, embedding, and native-tool surfaces.ToolServicecalls are behaviorally equivalent for exposed operations.Design constraints
ToolService/wright-agent/v1remain the semantic authority for Wright-owned agent operations.wright-agent/v1operation to become a native tool in the first version.Architecture questions
Resolve before implementation:
Non-goals
wright-agent/v1.Acceptance criteria
ToolServicesemantics.ToolService/wright-agent/v1requests.Dependencies / ownership
ToolService, and native-tool integration.wright-agent/v1and its committed schema.This issue intentionally stops at the architecture boundary first. Implementation details should follow the approved design rather than being inferred from a preferred transport.