McpToolsetConfig
Configuration for an McpToolset, used to construct one via toToolset.
Exactly one of stdioConnectionParams, sseConnectionParams, or streamableHttpConnectionParams must be set; toToolset throws if zero or more than one are provided.
Passing a headerProvider to toToolset causes headers to be resolved before discovery and again before each tool call. An IllegalArgumentException from that provider or from a ToolFilter.Predicate during McpToolset.getTools is wrapped in McpToolLoadingException.
Constructors
Types
Fluent builder for McpToolsetConfig, provided primarily for Java callers. Any property left unset falls back to the same default as the constructor.
Properties
Maximum length, in characters, of a single resource payload returned by load_mcp_resource. Longer payloads are truncated.
Connection parameters for an MCP server reached over SSE.
Connection parameters for a local MCP server reached over stdio (e.g. one launched via npx or python3).
Connection parameters for an MCP server reached over the Streamable HTTP transport.
Optional filter selecting which of the tools advertised by the server are exposed to the agent. Use ToolFilter.AllowList (or the ToolFilter.allowList helper) to keep tools by name, or ToolFilter.Predicate for context-aware selection that can consult the ReadonlyContext. When null, all tools advertised by the server are exposed. A server tool whose name ADK uses for its own tools, such as transfer_to_agent, is always skipped with a warning. The resource tools added by useMcpResources are ADK's own and are not filtered.
When true, resource-related tools (list_mcp_resources, list_mcp_resource_templates, load_mcp_resource) are added to the toolset, granting the agent access to MCP resources exposed by the server. They are added only if the server reports the resources capability during the handshake; against a server that does not, they are omitted and a warning is logged, because the MCP client rejects the requests those tools would make. toolFilter does not apply to them: it selects among the tools the server advertises, so enabling this flag and filtering the server's tools are independent choices. Defaults to false.
Functions
Returns a Builder initialized with this instance's properties, primarily for Java callers. Prefer it over copy from Java: copy takes every property positionally, so its signature changes whenever a property is added.
Creates an McpToolset from this configuration.