invoke_resource_action
Trigger specific operations on blockchain resources by providing a resource, action, and payload. Enables interaction with blockchain data through the Seitrace Insights MCP Server for querying token details, transactions, and smart contracts.
Instructions
Invoke a resource action with a payload matching its schema.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | ||
| payload | Yes | ||
| resource | Yes |
Implementation Reference
- The primary handler function for the 'invoke_resource_action' tool. It extracts resource and action from toolArgs, locates the corresponding resource using TOPIC_KEY_MAP, validates existence and action availability, and delegates execution to the resource's invokeResourceAction method.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); };
- src/handlers/tools_list.ts:60-76 (schema)Defines the Tool object for 'invoke_resource_action', including its name, description, and inputSchema specifying required properties: resource (string), action (string), payload (object).const invokeResourceAction: Tool = { name: INVOKE_RESOURCE_ACTION_TOOL, description: 'Invoke a resource action with the exact payload structure (step 4 - final step). IMPORTANT: You must first call get_resource_action_schema to determine the correct payload structure. Parameter names from action descriptions may differ from actual schema requirements.', inputSchema: { type: 'object', properties: { resource: { type: 'string' }, action: { type: 'string' }, payload: { type: 'object', additionalProperties: true }, }, required: ['resource', 'action', 'payload'], additionalProperties: false, description: 'Provide resource, action, and payload object matching the schema from get_resource_action_schema.', }, };
- src/handlers/index.ts:16-22 (registration)Registers all tool handlers in a map, specifically mapping INVOKE_RESOURCE_ACTION_TOOL to invokeResourceActionHandler for dispatch.export const handlerMap = { [LIST_RESOURCES_TOOL]: listResourcesHandler, [LIST_RESOURCE_ACTIONS_TOOL]: listResourceActionsHandler, [GET_RESOURCE_ACTION_SCHEMA_TOOL]: getResourceActionSchemaHandler, [GET_RESOURCE_ACTION_SNIPPET_TOOL]: getResourceActionSnippetHandler, [INVOKE_RESOURCE_ACTION_TOOL]: invokeResourceActionHandler, };