Skip to contents

Returns a list of ellmer tool definitions for all putior functions that can be exposed via MCP. This function is primarily used internally by putior_mcp_server, but can also be used directly for inspection or custom MCP server implementations.

Usage

putior_mcp_tools(include = NULL, exclude = c("run_sandbox"))

Arguments

include

Character vector of tool names to include. If NULL (default), all available tools are included.

exclude

Character vector of tool names to exclude. Default excludes "run_sandbox" since Shiny apps cannot run via MCP.

Value

A list of ellmer tool definitions suitable for use with mcptools::mcp_server(). A tool returns its result as text (JSON, Mermaid code or Markdown); when R warned, it returns a list of two ellmer::ContentText objects instead: the result and the warnings.

Details

The tools confine scans to a folder only in a server started by putior_mcp_server(type = "http") (see its Security section). In a custom server that other programs can reach, they scan any folder that the R process can read.

Examples

if (FALSE) { # \dontrun{
# Get all putior MCP tools
tools <- putior_mcp_tools()

# Get specific tools only
tools <- putior_mcp_tools(include = c("put", "put_diagram"))

# Exclude specific tools
tools <- putior_mcp_tools(exclude = c("run_sandbox", "putior_help"))
} # }