get_resource_action_schema
Retrieve the JSON Schema for a specific resource action to define and validate data structures in blockchain queries using the Seitrace API.
Instructions
Get the JSON Schema for a specific resource action.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | ||
| resource | Yes |
Implementation Reference
- The handler function that implements the core logic of the 'get_resource_action_schema' tool. It resolves the resource from the topic map, validates its existence, and delegates to the resource's getResourceActionSchema method.export const getResourceActionSchemaHandler = async ( toolArgs: ToolArgs ): Promise<CallToolResult> => { const { resource } = 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)) { return McpResponse(JSON.stringify({ error: `Unknown or missing resource '${resource}'.` })); } /** * List actions for the resource */ return foundResource.getResourceActionSchema(toolArgs); };
- src/handlers/tools_list.ts:44-58 (schema)Defines the Tool object including name, description, and inputSchema for the 'get_resource_action_schema' tool, used in tool listing and validation.const listResourceActionSchema: Tool = { name: GET_RESOURCE_ACTION_SCHEMA_TOOL, description: 'Get the JSON Schema for a specific resource action (step 3 - REQUIRED before invoking). This reveals the exact parameter names, types, and requirements. Always call this before invoke_resource_action.', inputSchema: { type: 'object', properties: { resource: { type: 'string' }, action: { type: 'string' }, }, required: ['resource', 'action'], additionalProperties: false, description: 'Provide resource and action from previous steps.', }, };
- src/handlers/index.ts:16-22 (registration)Registers the getResourceActionSchemaHandler under the tool name GET_RESOURCE_ACTION_SCHEMA_TOOL in the central handlerMap.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, };
- src/constants.ts:24-24 (helper)Defines the constant string for the tool name 'get_resource_action_schema'.export const GET_RESOURCE_ACTION_SCHEMA_TOOL = 'get_resource_action_schema';