Skip to main content
Glama
Seitrace

Seitrace Insights MCP Server

Official
by Seitrace
invoke_resource_action.ts1.13 kB
import { CallToolResult } from '@modelcontextprotocol/sdk/types.js'; import { ToolArgs } from '../topics/base.js'; import { TOPIC_KEY_MAP } from '../topics/index.js'; import { McpResponse } from '../utils/index.js'; /** * Handles the 'invokeResourceAction' tool request * @param toolArgs The arguments provided to the tool * @returns The result of the tool execution */ export const invokeResourceActionHandler = async ( toolArgs: ToolArgs, overrideApiKey?: string ): Promise<CallToolResult> => { const { resource, action } = toolArgs; const topicKey = resource.split('_')[0]; const foundResource = TOPIC_KEY_MAP[topicKey] || TOPIC_KEY_MAP[resource]; /** * Check if the resource exists */ if ( !foundResource || !(await foundResource.getResources()).has(resource) || !(await foundResource.hasResourceAction(resource, action!)) ) { return McpResponse( JSON.stringify({ error: `Unknown or missing resource '${resource}' or action '${action}'.` }) ); } /** * List actions for the resource */ return foundResource.invokeResourceAction(toolArgs, overrideApiKey); };

Implementation Reference

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Seitrace/seitrace-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server