We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/useshortcut/mcp-server-shortcut'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
test-helpers.ts•439 B
import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
/**
* Extracts the text content from the first content item of a CallToolResult.
* Throws if the content is not of type "text".
*/
export function getTextContent(result: CallToolResult): string {
const content = result.content[0];
if (content.type !== "text") {
throw new Error(`Expected text content but got ${content.type}`);
}
return content.text;
}