Interface McpClientInstance
- All Superinterfaces:
AgentInstance, InternalAgent
Implemented by every MCP client agent, created with
McpAgent or declared with the
@McpClientAgent annotation: gives access to the MCP tool bound by the agent.-
Method Summary
Modifier and TypeMethodDescriptionDescriptions published by the MCP tool for each input key; resolves the tool if not yet done.String[]The configured input keys of the agent, mandatory for an untyped agent, or null for a typed agent without explicit input keys, whose inputs are the parameters of its agent method.The description of the MCP tool; resolves the tool if not yet done.toolName()The name of the MCP tool bound by the agent: the configured one, else the name of the single tool of the MCP server, which is resolved at this point if not yet done.Returns the specification of the MCP tool bound by the agent, creating the MCP client and listing the tools of the server if not yet done.Methods inherited from interface AgentInstance
activationCondition, agentId, arguments, as, async, description, leaf, name, optional, outputKey, outputType, parent, plannerType, subagents, topology, typeMethods inherited from interface InternalAgent
allowChatMemory, allowStreamingOutput, appendId, compensateOnError, enableCrossAgentCompensation, listener, registerInheritedParentListener, setAgentId, setParent
-
Method Details
-
inputKeys
String[] inputKeys()The configured input keys of the agent, mandatory for an untyped agent, or null for a typed agent without explicit input keys, whose inputs are the parameters of its agent method. Never resolves the tool. -
inputDescriptions
-
toolName
String toolName()The name of the MCP tool bound by the agent: the configured one, else the name of the single tool of the MCP server, which is resolved at this point if not yet done. -
toolDescription
String toolDescription()The description of the MCP tool; resolves the tool if not yet done. -
toolSpecification
ToolSpecification toolSpecification()Returns the specification of the MCP tool bound by the agent, creating the MCP client and listing the tools of the server if not yet done. The tool is normally resolved on the first invocation of the agent, so this call blocks until the resolution completes, at most for the resolution timeout of the agent when one is set, and can be used to warm up the agent, or to fail fast, before its first invocation. Inside a declarative agentic system the MCP agent is wrapped: reach it throughsubagent.as(McpClientInstance.class)on the corresponding subagent of theAgentInstanceof the system.- Returns:
- the specification of the MCP tool bound by the agent
- Throws:
McpToolResolutionException- if the client cannot be created or the tools cannot be listed, or if this takes longer than the resolution timeoutAgenticSystemConfigurationException- if the tool is not found, if no tool name is configured and the server exposes more than one tool, or if the client supplier does not return an MCP client- Since:
- 1.24.0
-