Answer: Use Rpc.define to list the RPC's methods, errors, and events. Each method can define input and output schemas, an errors map for expected failures, and events are added to the top-level events map with a schema for the data sent to subscribers. Status: Confirmed Entry: tool/opencode/integrations/define-rpc-methods-errors-events Revision: 2 Digest: sha256:55a5d2325443594a (changes whenever the content changes) Timeline: Created: 2026-11-13T03:55:54Z Last changed: 2026-11-19T13:34:52Z (event data requirement: — → Event data must be an object.) Last verified: 2026-11-20T13:44:41Z Next check: 2026-11-21T13:44:41Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of definition method | Rpc.define | [1] | 2026-11-20 errors placement | errors map | [1] | 2026-11-20 events placement | top-level events map | [1] | 2026-11-20 reserved error prefix | rpc. | [1] | 2026-11-20 event data requirement | Event data must be an object. | [1] | 2026-11-20 Sources: [1] opencode. "Plugin RPC | OpenCode". https://opencode.ai/docs/build/plugins/rpc/ Role: primary. Accessed: 2026-11-20T13:44:41Z Quote: "Use Rpc.define to list the RPC’s methods, errors, and events." (Supports: definition method) Quote: "Add an errors map to a method for expected failures." (Supports: errors placement) Quote: "Add events to the top-level events map." (Supports: events placement) Quote: "Error names beginning with rpc. are reserved by OpenCode." (Supports: reserved error prefix) Quote: "Event data must be an object." (Supports: event data requirement) Snapshot SHA-256: 37434d54cb17cadeed5e125bd89c1835a46ec5999bd75168c1eaa7349e5372c9 (captured 2026-11-18T13:38:20Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-18T13:38:20Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:44:41Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:44:41Z Last attempt: 2026-11-20T13:44:41Z Notes and limitations: Extracted automatically from a single official source (section "Define"). Related: https://latestn.com/tool/opencode/integrations/define-rpc-methods-events How do I define an RPC with methods and events in an opencode Effect plugin? https://latestn.com/tool/opencode/integrations/effect-client-headers How do I add custom headers to requests with the opencode Effect client? https://latestn.com/tool/opencode/integrations/effect-plugin-rpc How do I call opencode plugin RPC methods from the Effect client? https://latestn.com/tool/opencode/integrations/create-pairing-code How do I create a pairing code with the opencode API? https://latestn.com/tool/opencode/integrations/customize-effect-layers How do I customize or provide layers in the opencode Effect SDK? https://latestn.com/tool/opencode/integrations/define-gui-plugin How do I define a GUI plugin for opencode? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-19T13:34:52Z | changed | event data requirement: — → Event data must be an object. | [1] 2026-11-19T13:34:52Z | changed | events placement: — → top-level events map | [1] 2026-11-19T13:34:52Z | changed | errors placement: — → errors map | [1] 2026-11-19T13:34:52Z | changed | definition method: — → Rpc.define | [1] 2026-11-19T13:34:52Z | changed | event schema: schema → — | [1] 2026-11-19T13:34:52Z | changed | events: events → — | [1] 2026-11-19T13:34:52Z | changed | errors: errors → — | [1] 2026-11-19T13:34:52Z | changed | methods: methods → — | [1] 2026-11-19T13:34:52Z | changed | definition function: Rpc.define → — | [1] 2026-11-13T03:55:54Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/opencode/integrations/define-rpc-methods-errors-events/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/opencode/integrations/define-rpc-methods-errors-events POST: https://latestn.com/dispute/tool/opencode/integrations/define-rpc-methods-errors-events with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/opencode/integrations/define-rpc-methods-errors-events?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I define RPC methods, errors, and events in an opencode plugin? Revision 2, last verified 2026-11-20T13:44:41Z. https://latestn.com/tool/opencode/integrations/define-rpc-methods-errors-events (accessed 2026-11-21T09:52:27Z). @misc{LatestN_tool_opencode_integrations_define_rpc_methods_errors_events_r2, title = {How do I define RPC methods, errors, and events in an opencode plugin?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/opencode/integrations/define-rpc-methods-errors-events}}, note = {Revision 2; digest sha256:55a5d2325443594a; last verified 2026-11-20T13:44:41Z; accessed 2026-11-21T09:52:27Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/opencode/integrations/define-rpc-methods-errors-events