Skip to contents

Calls the tool with call_tool() and checks its structuredContent against the output schema that @mcpOutput declares, as the MCP specification asks clients to do.

Usage

expect_structured_output(
  tool,
  args = list(),
  package = testthat::testing_package(),
  ...
)

Arguments

tool

Name of the tool.

args

Named list of arguments.

package

Package that serves the tool, by default the one being tested.

...

Passed to call_tool().

Value

The tool result, invisibly.

Examples

if (FALSE) { # \dontrun{
# In the tests of a package made by create_mordew():
expect_structured_output(
  "year_totals",
  list(
    year = 2025
  )
)
} # }