List all available agents with their names, descriptions, and modes (primary/subagent)

Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory.

Ask OpenCode a question in one step. Creates a new session, sends your prompt, and returns the AI response. This is the easiest way to interact with OpenCode.

Agent to use (e.g. 'build', 'plan')

Model ID (e.g. 'claude-3-5-sonnet-20241022')

The question or instruction to send

Provider ID (e.g. 'anthropic')

Optional system prompt override

Optional title for the session

Model variant (e.g. 'fast', 'smart')

Set authentication credentials for a provider (e.g. API key). Credentials are stored globally and shared across all projects.

API key or credential value

Provider ID (e.g. 'anthropic')

Auth type (e.g. 'api')

Get a compact cached progress report for a session. Much cheaper than opencode_conversation or opencode_wait — returns status, todos, and file counts in a single call. Use this to monitor sessions launched with opencode_fire.

If true, include the last message text (default: false)

Session ID to check

Execute a slash command in a session (e.g. /init, /undo, /redo)

Agent to use

Arguments for the command

The slash command to execute (e.g. 'init', 'undo')

Model ID

Provider ID

Session ID

Model variant

List all available commands (built-in and custom slash commands)

Get the current opencode configuration

List all configured providers and their default models

Update the opencode configuration. Pass a partial config object with fields to update.

Partial config object with fields to update

Get full project context in one call: current project, path, VCS info, config, and available agents. Useful to understand the current state before starting work.

Get the full conversation history of a session, formatted for easy reading. Shows all messages with their roles and content.

Max messages to return (default: all)

Session ID

Poll for recent events from the OpenCode server. Collects events for the specified duration and returns them. Useful for monitoring session activity, deployments, and system changes.

How long to collect events in milliseconds (default: 3000, max: 30000)

Maximum number of events to collect (default: 50)

List files and directories at a path

Path to list (defaults to project root)

Read the content of a file

File path to read

Get status for tracked files (VCS changes: modified, added, deleted, etc.)

Find files and directories by name (fuzzy match)

Max number of results (1-200)

Search string for file/directory names

Override the project root for the search

Limit results to 'file' or 'directory'

Find workspace symbols by name (functions, classes, variables, etc.)

Symbol name to search for

Search for text patterns in project files (regex supported). Returns file paths, line numbers, and matching lines.

Text or regex pattern to search for in files

Fire-and-forget: send a task to OpenCode and return immediately. OpenCode works autonomously in the background. Use `opencode_check` to check progress anytime. Best for long-running tasks when you want to do other work in parallel.

Agent to use

Model ID (e.g. 'claude-opus-4-6')

The task or instruction to send

Provider ID (e.g. 'anthropic')

Existing session ID to continue (omit to create a new session)

Session title (only for new sessions)

Model variant

Get the status of configured formatters

Check server health and version

Dispose the current opencode instance (shuts it down). WARNING: This is destructive and will terminate the server.

Write a log entry to the opencode server

Extra data to include in the log entry

Log level

Log message

Service name for the log entry

Get the status of LSP (Language Server Protocol) servers

Add an MCP server dynamically to opencode

MCP server configuration object

Name for the MCP server

Get the status of all MCP servers configured in opencode

Get details of a specific message in a session

Message ID

Session ID

List all messages in a session with formatted output showing roles and content

Maximum number of messages to return

Session ID

Send a prompt message to a session and wait for the AI response. Use parts to send text, and optionally specify a model.

Agent to use

Model ID (e.g. 'claude-3-5-sonnet-20241022')

If true, inject context without triggering AI response (useful for plugins)

Provider ID (e.g. 'anthropic')

Session ID

System prompt override

The text message to send

Model variant (e.g. 'fast', 'smart')

Send a prompt message asynchronously (fire-and-forget, does not wait for response). Use opencode_wait to poll for completion.

Agent to use

Provider ID (e.g. 'anthropic')

Session ID

The text message to send

Model variant (e.g. 'fast', 'smart')

Get the current working path of the opencode server

List all pending permission requests across all sessions. When a session is blocked waiting for approval (e.g. to run a shell command or access a file outside the project), it appears here. Respond with `opencode_session_permission`.

Get the current active project

Initialize or open a project directory to host an independent OpenCode session. Use this to create new empty folders, or to explicitly open preexisting projects on the host machine for parallel code generation workloads.

The absolute file path where the project directory is located or should be created.

List all projects known to the opencode server

Get available authentication methods for all providers

List all configured providers with their connection status. Returns a compact summary — use opencode_provider_models to see models for a specific provider.

List available models for a specific provider. Call opencode_provider_list first to see provider IDs.

Max models to show (default 30). Use 0 for all.

Provider ID (e.g. 'anthropic', 'openrouter', 'google')

Start OAuth authorization for a provider

Provider ID to authorize

Handle OAuth callback for a provider

OAuth callback data

Provider ID

Quick-test whether a provider is working. Creates a temporary session, sends a trivial prompt, checks the response, and cleans up. Great for debugging auth issues.

Specific model ID to test. If omitted, uses provider default.

Provider ID to test (e.g. 'anthropic', 'openrouter')

Model variant

Send a follow-up message to an existing session. Use this to continue a conversation started with opencode_ask or opencode_session_create.

Agent to use

Model ID

The follow-up message

Provider ID

Session ID to reply in

Model variant

Get a formatted summary of all file changes made in a session. Shows diffs in a readable format.

Specific message ID to get diff for

Session ID

Send a task to OpenCode and wait for completion. Combines session creation, async prompt, and polling into a single tool call. Use this instead of the manual opencode_message_send_async + opencode_wait pattern.

Agent to use

Max seconds to wait for completion (default: 600 = 10 minutes)

Model ID (e.g. 'claude-opus-4-6')

The task or instruction to send

Provider ID (e.g. 'anthropic')

Session title (only for new sessions)

Model variant

Abort a running session

Session ID to abort

Get child sessions of a session

Parent session ID

Create a new session. Optionally provide a parentID to create a child session, and a title.

Parent session ID

Session title

Delete a session and all its data

Session ID to delete

Get the diff for a session, optionally for a specific message

Session ID

Message ID (optional)

Fork an existing session, optionally at a specific message

Session ID to fork

Message ID to fork at (optional)

Get details of a specific session by ID

Session ID

Analyze the app and create AGENTS.md for a session. NOTE: This is a long-running operation that may take 30-60+ seconds depending on project size.

Session ID

Message ID

Model ID (e.g. 'claude-3-5-sonnet-20241022')

Provider ID (e.g. 'anthropic')

Model variant (e.g. 'fast', 'smart')

List all sessions

Respond to a permission request in a session. Use `opencode_permission_list` to see pending requests. Reply values: 'once' (approve this request only), 'always' (approve this + future matching requests for this session), 'reject' (deny the request).

Session ID

Permission request ID

Response to the permission request: 'once' to approve once, 'always' to auto-approve matching future requests, 'reject' to deny

Revert a message in a session

Session ID

Message ID to revert

Part ID to revert (optional)

Search sessions by keyword in title. Useful for finding a specific session among many.

Search keyword (case-insensitive match on session title)

Share a session publicly

Session ID to share

Get status for all sessions (running, idle, etc.)

Summarize a session using a specified model. NOTE: This is a long-running operation that may take 30-60+ seconds.

Session ID

Provider ID (e.g. 'anthropic')

Model variant (e.g. 'fast', 'smart')

Get the todo list for a session

Session ID

Restore all reverted messages in a session

Session ID

Unshare a previously shared session

Session ID to unshare

Update session properties (e.g. title)

Session ID

New title for the session

Get a quick overview of all sessions with their titles and status. Useful to find which session to continue working in.

Check OpenCode status, provider configuration, and optionally initialize a project directory. Use this as the first step when starting work — it tells you what is ready and what still needs configuration.

Run a shell command through the opencode session

Agent to use for the shell command

Shell command to execute

Model ID

Provider ID

Session ID

Model variant

Get a quick status dashboard: server health, provider count, session count, and VCS info. Lighter than opencode_setup — good for at-a-glance checks.

List all available tool IDs that the LLM can use (experimental)

List tools with JSON schemas for a given provider and model (experimental)

Model ID

Provider ID

Append text to the TUI's prompt input field

Text to append to the prompt

Clear the current prompt text in the TUI

Execute a slash command through the TUI (e.g. '/init', '/undo')

Command to execute (e.g. '/init')

Open the help dialog in the TUI

Open the model selector in the TUI

Open the session selector in the TUI

Open the theme selector in the TUI

Show a toast notification in the TUI

Toast message text

Optional toast title

Toast variant (default: info)

Submit the current prompt in the TUI (equivalent to pressing Enter)

Get VCS (version control) info for the current project (branch, remote, status)

Poll a session until it finishes processing. Use after opencode_message_send_async to wait for the AI to complete its response. Sends progress notifications while waiting. If timeout is reached, returns a progress report (not an error). For long tasks, consider using opencode_session_todo to check progress instead of blocking.

Polling interval in ms (default: 2000)

Session ID to wait on

Max seconds to wait (default: 120). Set higher (300-600) for complex tasks.


Add a data series to an existing chart

Series color (hex)

Chart element ID

Path to the PPTX file

Series name

Zero-based slide index

Data values

filePath slideIndex elementId name values

Add a text, shape, image, table, or connector element

Text alignment

Alt text for accessibility

Bold text

Table cell data as 2D array

Number of table columns

End arrow type

Connect end to shape ID

Path to the PPTX file

Fill color (hex)

Font color (hex)

Font family name

Font size in points

Style first row as header

Height in points

Image as base64 data URL

Italic text

Number of table rows

Shape type (e.g. "rect", "ellipse")

Zero-based slide index

Start arrow type

Connect start to shape ID

Stroke color (hex)

Stroke width in points

Text content

Element type to add

Underline text

Width in points

X position in points

Y position in points

Add a new blank slide to the presentation

Background color (hex)

Path to the PPTX file

Insert after this slide index

Apply a slide layout to a specific slide

Path to the PPTX file

Layout name to apply

Layout type to apply (alternative to name)

Zero-based slide index

Replace {{placeholder}} tokens with provided values (mail merge)

Template data: keys are placeholder names, values are replacement values

Path to the PPTX file

Apply a built-in theme preset to the presentation

Path to the PPTX file

Theme preset name (e.g. "OFFICE", "MODERN_BLUE", "EARTH", "MONOCHROME", "VIBRANT", "CORPORATE", "MINIMAL", "DARK")

Align elements or change z-order (layer)

Element ID (for reorderLayer)

Element IDs (for align)

Path to the PPTX file

bringForward sendBackward bringToFront sendToBack

Apply the same properties to multiple elements

Path to the PPTX file

Clone an element within or across slides

Path to the PPTX file

Convert the presentation to Markdown format

Path to the PPTX file

Include presentation metadata

Include speaker notes

Name for extracted media folder

Output directory for markdown and media

Use semantic (clean) markdown mode

Slide range to convert

Create a new chart element on a slide

Category labels

Chart type (bar, line, pie, scatter, area, doughnut, radar, histogram, waterfall, funnel, treemap, sunburst, boxWhisker, regionMap). "pareto" is also accepted: it is authored as a histogram chart with an added cumulative-percentage line series.

Path to the PPTX file

Height in points

Legend configuration

Data series

Zero-based slide index

Chart title

Width in points

X position in points

Y position in points

Delete one or more elements by ID

Element IDs to delete

Path to the PPTX file

Delete one or more slides by index

Path to the PPTX file

Slide indexes to delete

Duplicate a slide with new element IDs

Path to the PPTX file

Slide to duplicate

Where to insert the duplicate

Export a single slide to SVG

Default font family for SVG

Default font size

Path to the PPTX file

Zero-based slide index to export

Export the presentation to the portable pptx-viewer-json document format (self-contained, binary assets embedded as base64)

Path to the PPTX file

Pretty-print the JSON document with 2-space indentation (default true)

Export all or specific slides to SVG strings

Default font family for SVG

Default font size

Path to the PPTX file

Include hidden slides

Specific slides to export (all if omitted)

Discover all {{placeholder}} tokens in the presentation

Path to the PPTX file

Search for text across all slides

Case-sensitive search

Path to the PPTX file

Text to search for

Limit search to specific slides

Treat query as regex

List available slide layouts from the presentation masters

Path to the PPTX file

Get presentation metadata (title, author, keywords, custom properties)

Path to the PPTX file

Get slideshow properties (show type, loop, advance mode, slide range)

Path to the PPTX file

Inspect a single slide: returns layout, notes, elements

Path to the PPTX file

Zero-based slide index

Get current theme information (colors, fonts, available presets)

Path to the PPTX file

Group multiple elements into a group

At least 2 element IDs to group

Path to the PPTX file

Replace the presentation content with a deck imported from a pptx-viewer-json document

Path to the PPTX file

The pptx-viewer-json document text to import (replaces the deck content)

List, add, delete, or resolve slide comments

Path to the PPTX file

List, set, or remove hyperlinks/actions on elements

Hyperlink action

Link action type

url slide nextSlide prevSlide firstSlide lastSlide endShow

Element ID (for set/remove)

Path to the PPTX file

Zero-based slide index

Target slide index for internal links

Tooltip text

Action trigger (default: click)

URL for the hyperlink

List, add, remove, reorder sections or move slides between sections

Section action

list add remove reorder moveSlides getForSlide

Path to the PPTX file

Section name (for add)

Section ID (for remove, moveSlides)

Ordered section IDs (for reorder)

Slide index (for getForSlide)

Slide indices (for add, moveSlides)

Manage SmartArt: get nodes, add/remove/reorder/promote/demote nodes, or decompose to shapes

SmartArt action

getNodes addNode removeNode updateNodeText reorderNode promoteNode demoteNode decompose

Insert after this node ID

Reorder direction: 1 (forward) or -1 (backward)

SmartArt element ID

Path to the PPTX file

Node ID (required for most actions)

Zero-based slide index

Text for addNode or updateNodeText

Insert or delete table rows and columns

insertRow deleteRow insertColumn deleteColumn

Table element ID

Path to the PPTX file

Insertion position index

Remove a data series from a chart by index

Chart element ID

Path to the PPTX file

Zero-based series index to remove

Zero-based slide index

Rename an element (the selection pane's display name; cNvPr/@name)

Element ID to rename

Path to the PPTX file

New element name (empty string clears the name)

Zero-based slide index

Reorder slides by providing a new index array

Path to the PPTX file

New slide order as array of indexes

Auto-repair common PPTX structural issues

Path to the PPTX file

Replace a shape element geometry with a preset or custom SVG path

Shape adjustment values

Shape element ID

Path to the PPTX file

Height of SVG path coordinate space

Width of SVG path coordinate space

Preset shape type (e.g. "roundRect", "star5", "ellipse", "diamond")

Zero-based slide index

Custom SVG path data (mutually exclusive with shapeType)

Find and replace text across slides

Path to the PPTX file

Text to find

Replacement text

Audit the presentation for accessibility issues

Path to the PPTX file

Change the presentation canvas dimensions

Path to the PPTX file

Canvas height in points

Canvas width in points

Set entrance/exit animation on an element

Path to the PPTX file

Lock or unlock an element (prevent move, resize, rotation, selection, text edit)

Element ID to lock/unlock

Path to the PPTX file

Whether the element should be locked

Prevent moving

Prevent resizing

Prevent rotation

Prevent selection

Prevent text editing

Zero-based slide index

Set or remove a slide transition effect

Auto-advance after ms

Advance on mouse click

Direction (e.g. "left", "right")

Duration in ms

Path to the PPTX file

Zero-based slide index

Transition type (e.g. "fade", "wipe", "none")

Ungroup a group element back to individual elements

Path to the PPTX file

Group element ID to ungroup

Update chart type, title, legend, data labels, axis, or categories

Axis configuration

Axis type: valAx, catAx, dateAx, serAx

Category axis labels

New chart type (bar, line, pie, scatter, area, doughnut, radar, histogram, waterfall, funnel, treemap, sunburst, boxWhisker, regionMap). "pareto" is also accepted: it is authored as a histogram chart with an added cumulative-percentage line series.

Data label configuration

Chart element ID

Path to the PPTX file

Bar/column grouping

Legend configuration

Legend position: b, t, l, r, tr

Zero-based slide index

Chart title

Update data values for a chart series

Chart element ID

Path to the PPTX file

Zero-based series index

Zero-based slide index

New data values

filePath slideIndex elementId seriesIndex values

Update element position, size, text, or style

Element ID to update

Path to the PPTX file

Zero-based slide index

Update fill, stroke, shadow, glow, or image effects

Path to the PPTX file

Update presentation metadata (title, author, company, custom properties)

Category

Company name

Creator/author name

Custom properties to set

Description/comments

Path to the PPTX file

Keywords (comma-separated)

Last modified by

Manager name

Subject

Presentation title

Update slideshow properties (show type, loop, advance mode, pen color)

Slide advance mode

Path to the PPTX file

Loop the slideshow

Annotation pen color (hex)

Range start (1-based)

Which slides to show

Range end (1-based)

Slideshow mode

Play animations

Play narration

Update slide background, notes, or visibility

Background color (hex)

Background gradient CSS

Background image data URL

Path to the PPTX file

Whether slide is hidden

Speaker notes text

Zero-based slide index

Update text content of table cells

Cells to update

Table element ID

Path to the PPTX file

Update individual theme colors (accent1-6, dk1/2, lt1/2, hlink, folHlink)

Accent 1 color (hex)

Accent 2 color (hex)

Accent 3 color (hex)

Accent 4 color (hex)

Accent 5 color (hex)

Accent 6 color (hex)

Dark 1 color (hex)

Dark 2 color (hex)

Path to the PPTX file

Followed hyperlink color (hex)

Hyperlink color (hex)

Light 1 color (hex)

Light 2 color (hex)

Update theme heading (major) and body (minor) fonts

Path to the PPTX file

Heading (major) font family

Body (minor) font family

Validate PPTX structural integrity (content types, relationships, XML)

Path to the PPTX file