/**
 * Shared helpers for MCP gateway tools.
 */
/** Build a standardized error ToolResult from a message string. */
export function errorResult(text) {
    return {
        content: [{ type: 'text', text }],
        details: undefined,
        isError: true
    };
}
/** Look up an MCP connection by server name; returns an error string if not found. */
export function resolveServer(connections, serverName) {
    const conn = connections.get(serverName);
    if (!conn) {
        return `Unknown MCP server '${serverName}'. Available: ${[...connections.keys()].join(', ') || '(none)'}`;
    }
    return conn;
}
//# sourceMappingURL=tool-helpers.js.map