Package org.mockserver.client
Class McpMockBuilder.McpToolBuilder
java.lang.Object
org.mockserver.client.McpMockBuilder.McpToolBuilder
- Enclosing class:
- McpMockBuilder
-
Method Summary
Modifier and TypeMethodDescriptionand()respondingWith(String textContent) respondingWith(String textContent, boolean isError) respondingWithResourceLink(String uri, String name, String description, String mimeType) Add a resource link (MCP 2025-06-18) to thetools/callresult content, referencing a resource the client can read rather than inlining it.respondingWithStructured(String textContent, String structuredContentJson) Return structured tool output (MCP 2025-06-18): a machine-readable JSON object emitted asstructuredContentin thetools/callresult, alongside the text content block.withDescription(String description) withInputSchema(String jsonSchema) withOutputSchema(String jsonSchema) Advertise a JSON Schema (MCP 2025-06-18 structured tool output) that the tool'sstructuredContentconforms to.
-
Method Details
-
withDescription
-
withInputSchema
-
withOutputSchema
Advertise a JSON Schema (MCP 2025-06-18 structured tool output) that the tool'sstructuredContentconforms to. Emitted asoutputSchemaintools/list. -
respondingWith
-
respondingWith
-
respondingWithStructured
public McpMockBuilder.McpToolBuilder respondingWithStructured(String textContent, String structuredContentJson) Return structured tool output (MCP 2025-06-18): a machine-readable JSON object emitted asstructuredContentin thetools/callresult, alongside the text content block.- Parameters:
textContent- the human-readable text block (may be null to omit it)structuredContentJson- the structured result as a JSON object string
-
respondingWithResourceLink
public McpMockBuilder.McpToolBuilder respondingWithResourceLink(String uri, String name, String description, String mimeType) Add a resource link (MCP 2025-06-18) to thetools/callresult content, referencing a resource the client can read rather than inlining it.- Parameters:
uri- the resource URI (required)name- a human-readable name (may be null)description- a description (may be null)mimeType- the resource MIME type (may be null)
-
and
-