Help us shape the future of Go! Take the 2026 Go Developer Survey

webmcp

package
v0.159.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 3 Imported by: 1

Documentation

Overview

Package webmcp provides the Chrome DevTools Protocol commands, types, and events for the WebMCP domain.

Generated by the pdlgen command.

Index

Constants

View Source
const (
	CommandEnable           = "WebMCP.enable"
	CommandDisable          = "WebMCP.disable"
	CommandInvokeTool       = "WebMCP.invokeTool"
	CommandCancelInvocation = "WebMCP.cancelInvocation"
)

Command names.

Variables

CancelInvocation cancels a pending tool invocation.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebMCP#method-cancelInvocation

View Source
var Disable = cdp.Command[cdp.Empty, cdp.Empty]{Method: CommandDisable}

Disable disables the WebMCP domain.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebMCP#method-disable

Enable enables the WebMCP domain, allowing events to be sent. Enabling the domain will trigger a toolsAdded event for all currently registered tools.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebMCP#method-enable

InvokeTool invokes a registered tool.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebMCP#method-invokeTool

View Source
var ToolInvoked = cdp.Event[EventToolInvoked]{Method: "WebMCP.toolInvoked"}

ToolInvoked event fired when a tool invocation starts.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebMCP#event-toolInvoked

View Source
var ToolResponded = cdp.Event[EventToolResponded]{Method: "WebMCP.toolResponded"}

ToolResponded event fired when a tool invocation completes or fails.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebMCP#event-toolResponded

View Source
var ToolsAdded = cdp.Event[EventToolsAdded]{Method: "WebMCP.toolsAdded"}

ToolsAdded event fired when new tools are added.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebMCP#event-toolsAdded

View Source
var ToolsRemoved = cdp.Event[EventToolsRemoved]{Method: "WebMCP.toolsRemoved"}

ToolsRemoved event fired when tools are removed.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebMCP#event-toolsRemoved

Functions

This section is empty.

Types

type Annotation

type Annotation struct {
	ReadOnly         bool `json:"readOnly"`         // A hint indicating that the tool does not modify any state.
	UntrustedContent bool `json:"untrustedContent"` // A hint indicating that the tool output may contain untrusted content, ex: UGC, 3rd party data.
	Consequential    bool `json:"consequential"`    // A hint indicating that executing the tool will result in consequential actions, ex: booking a flight, transferring money.
	Debugging        bool `json:"debugging"`        // If true, indicates that the tool is intended for debugging and developer tooling rather than end-user interactions.
	Autosubmit       bool `json:"autosubmit"`       // If the declarative tool was declared with the autosubmit attribute.
}

Annotation tool annotations.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebMCP#type-Annotation

type CancelInvocationParams

type CancelInvocationParams struct {
	InvocationID string `json:"invocationId"` // Invocation identifier to cancel.
}

CancelInvocationParams are the parameters of the command WebMCP.cancelInvocation.

type EventToolInvoked

type EventToolInvoked struct {
	ToolName     string      `json:"toolName"`     // Name of the tool to invoke.
	FrameID      cdp.FrameID `json:"frameId"`      // Frame id
	InvocationID string      `json:"invocationId"` // Invocation identifier.
	Input        string      `json:"input"`        // The input parameters used for the invocation.
}

EventToolInvoked event fired when a tool invocation starts.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebMCP#event-toolInvoked

type EventToolResponded

type EventToolResponded struct {
	InvocationID string                `json:"invocationId"`                 // Invocation identifier.
	Status       InvocationStatus      `json:"status"`                       // Status of the invocation.
	Output       jsonv2.Value          `json:"output,omitempty,omitzero"`    // Output or error delivered as delivered to the agent. Missing if status is anything other than Completed. Note: The output is untrusted and poses a prompt injection risk. Clients should treat this as potentially malicious user input.
	ErrorText    string                `json:"errorText,omitempty,omitzero"` // Error text for protocol users.
	Exception    *runtime.RemoteObject `json:"exception,omitempty,omitzero"` // The exception object, if the javascript tool threw an error>
}

EventToolResponded event fired when a tool invocation completes or fails.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebMCP#event-toolResponded

type EventToolsAdded

type EventToolsAdded struct {
	Tools []*Tool `json:"tools"` // Array of tools that were added.
}

EventToolsAdded event fired when new tools are added.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebMCP#event-toolsAdded

type EventToolsRemoved

type EventToolsRemoved struct {
	Tools []*RemovedTool `json:"tools"` // Array of tools that were removed.
}

EventToolsRemoved event fired when tools are removed.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebMCP#event-toolsRemoved

type InvocationStatus

type InvocationStatus string

InvocationStatus represents the status of a tool invocation.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebMCP#type-InvocationStatus

const (
	InvocationStatusCompleted InvocationStatus = "Completed"
	InvocationStatusCanceled  InvocationStatus = "Canceled"
	InvocationStatusError     InvocationStatus = "Error"
)

InvocationStatus values.

func (InvocationStatus) String

func (t InvocationStatus) String() string

String returns the InvocationStatus as string value.

type InvokeToolParams

type InvokeToolParams struct {
	FrameID  cdp.FrameID  `json:"frameId"`  // Frame in which to invoke the tool.
	ToolName string       `json:"toolName"` // Name of the tool to invoke.
	Input    jsonv2.Value `json:"input"`
}

InvokeToolParams are the parameters of the command WebMCP.invokeTool.

type InvokeToolResult added in v0.157.3

type InvokeToolResult struct {
	InvocationID string `json:"invocationId,omitempty,omitzero"` // Unique identifier for this invocation. Response is sent before tool events.
}

InvokeToolResult is the result of the command WebMCP.invokeTool.

type RemovedTool

type RemovedTool struct {
	Name    string      `json:"name"`    // Tool name.
	FrameID cdp.FrameID `json:"frameId"` // Frame identifier associated with the tool registration.
}

RemovedTool definition of a tool that was removed.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebMCP#type-RemovedTool

type Tool

type Tool struct {
	Name          string              `json:"name"`        // Tool name.
	Description   string              `json:"description"` // Tool description.
	InputSchema   jsonv2.Value        `json:"inputSchema,omitempty,omitzero"`
	Annotations   *Annotation         `json:"annotations,omitempty,omitzero"`   // Optional annotations for the tool.
	FrameID       cdp.FrameID         `json:"frameId"`                          // Frame identifier associated with the tool registration.
	BackendNodeID cdp.BackendNodeID   `json:"backendNodeId,omitempty,omitzero"` // Optional node ID for declarative tools.
	StackTrace    *runtime.StackTrace `json:"stackTrace,omitempty,omitzero"`    // The stack trace at the time of the registration.
}

Tool definition of a tool that can be invoked.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebMCP#type-Tool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL