Skip to main content
sunpeak API

Overview

Returns a function to invoke other MCP tools registered on the server. Useful for multi-step workflows where one app needs to trigger another tool.

Wraps callServerTool

MCP Apps SDK reference

Import

Signature

CallServerToolParams

name
string
required
Name of the MCP tool to call.
arguments
Record<string, unknown>
Arguments to pass to the tool.

Returns

callTool
(params: CallServerToolParams) => Promise<CallServerToolResult | undefined>
Function to call an MCP server tool.

CallServerToolResult

content
Array<{ type: string; text?: string }>
Tool response content (human-readable text for the host model).
structuredContent
Record<string, unknown>
Structured data from the tool response. Use this for machine-readable data the calling resource needs to render (e.g., { status: 'success', message: '...' }).
isError
boolean
Whether the tool call resulted in an error. Only set for actual execution failures — not for expected outcomes like cancellations.

Usage