webmcp

package
v0.159.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 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. Exactly one of toolId and toolName must be specified; the command fails if both or neither are.

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 {
	FrameID      cdp.FrameID `json:"frameId"`                     // Frame id
	InvocationID string      `json:"invocationId"`                // Invocation identifier.
	Input        string      `json:"input"`                       // The input parameters used for the invocation.
	ToolName     string      `json:"toolName,omitempty,omitzero"` // Name of the tool to invoke. Missing if the tool was invoked by its identifier, but could not be found (e.g., it was already unregistered), so its name could not be recovered.
	ToolID       ToolID      `json:"toolId,omitempty,omitzero"`   // Identifier of the tool to invoke. Missing if the tool was invoked by name, but could not be found, so its identifier could not be recovered.
}

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.
	ToolID  ToolID       `json:"toolId,omitempty,omitzero"` // Identifier of the tool to invoke, as reported in Tool.toolId. Invokes exactly that tool, and fails if it is no longer registered, even if a different tool has since been registered under the same name.
	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 {
	ToolID  ToolID      `json:"toolId"`  // Identifier of the removed tool.
	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 {
	ToolID        ToolID              `json:"toolId"`      // Tool identifier.
	Name          string              `json:"name"`        // Tool name.
	Description   string              `json:"description"` // Tool description.
	InputSchema   jsonv2.Value        `json:"inputSchema,omitempty,omitzero"`
	OutputSchema  jsonv2.Value        `json:"outputSchema,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

type ToolID added in v0.159.1

type ToolID string

ToolID unique identifier of a registered tool. A new identifier is created every time a tool is registered, so a tool that is unregistered and then registered again under the same name gets a different identifier. Clients should treat it as an opaque string.

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

func (ToolID) String added in v0.159.1

func (t ToolID) String() string

String returns the ToolID as string value.

Jump to

Keyboard shortcuts

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