Skip to main content
Glama

Get Action Knowledge

get_pica_action_knowledge

Retrieve detailed documentation for a specific action, including parameters, requirements, and usage examples. Essential step before executing actions on the MCP server to ensure proper understanding and successful execution.

Instructions

Get comprehensive documentation for a specific action including parameters, requirements, and usage examples. MANDATORY: You MUST call this tool before execute_pica_action to understand the action's requirements, parameter structure, caveats, and proper usage. This loads the action documentation into context and is required for successful execution.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
action_idYesThe action ID to get knowledge for (from the actions list returned by get_pica_platform_actions). REQUIRED: This tool must be called before create_pica_request to load the action's documentation into context.
platformYesThe platform name to get knowledge for (e.g., 'ship-station', 'shopify'). This is the kebab-case version of the platform name that comes from the list_pica_integrations tool AVAILABLE PLATFORMS section.

Implementation Reference

  • Core handler function executing the tool: fetches knowledge from PicaClient.getActionKnowledge, formats with buildActionKnowledgeWithGuidance helper, returns formatted text content.
    async function handleGetActionKnowledge(args: GetPicaActionKnowledgeArgs) {
      try {
        const actionId = args.actionId;
        const { knowledge, method } = await picaClient.getActionKnowledge(actionId);
    
        const knowledgeWithGuidance = buildActionKnowledgeWithGuidance(
          knowledge,
          method,
          picaClient.getBaseUrl(),
          args.platform,
          actionId
        );
    
        return {
          content: [
            {
              type: "text" as const,
              text: knowledgeWithGuidance,
            },
          ],
        };
      } catch (error) {
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to retrieve action knowledge: ${error instanceof Error ? error.message : 'Unknown error'}`
        );
      }
  • src/index.ts:105-112 (registration)
    MCP server tool registration, linking name, config/schema, and handler function.
    server.registerTool(
      "get_pica_action_knowledge",
      getPicaActionKnowledgeToolConfig,
      async (args: z.infer<typeof getPicaActionKnowledgeZodSchema>) => {
        await initializePica();
        return await handleGetActionKnowledge(args as GetPicaActionKnowledgeArgs);
      }
    );
  • Tool configuration including title, description, and input schema reference used for registration.
    export const getPicaActionKnowledgeToolConfig = {
        title: "Get Action Knowledge",
        description: "Get comprehensive documentation for a specific action including parameters, requirements, and usage examples. MANDATORY: You MUST call this tool before execute_pica_action to understand the action's requirements, parameter structure, caveats, and proper usage. This loads the action documentation into context and is required for successful execution.",
        inputSchema: getPicaActionKnowledgeInputSchema
    };
  • Zod input schema definition for tool parameters (actionId and platform).
    /**
     * Schema for getting action knowledge
     */
    export const getPicaActionKnowledgeInputSchema = {
        actionId: z.string().describe("The action ID to get knowledge for (from the actions list returned by search_pica_platform_actions). REQUIRED: This tool must be called before execute_pica_action to load the action's documentation into context."),
        platform: z.string().describe("The platform name to get knowledge for (e.g., 'ship-station', 'shopify'). This is the kebab-case version of the platform name that comes from the list_pica_integrations tool AVAILABLE PLATFORMS section.")
    };
  • Helper function that formats raw action knowledge with API request structure guidance, appended to the response.
    export function buildActionKnowledgeWithGuidance(
      knowledge: string,
      method: string,
      baseUrl: string,
      platform: string,
      actionId: string
    ): string {
      const cleanBaseUrl = baseUrl.replace(/\/$/, '');
    
      return `${knowledge}
    
    API REQUEST STRUCTURE
    ======================
    URL: ${cleanBaseUrl}/v1/passthrough/{{PATH}}
    
    IMPORTANT: When constructing the URL, only include the API endpoint path after the base URL.
    Do NOT include the full third-party API URL.
    
    Examples:
    ✅ Correct: ${cleanBaseUrl}/v1/passthrough/crm/v3/objects/contacts/search
    ❌ Incorrect: ${cleanBaseUrl}/v1/passthrough/https://api.hubapi.com/crm/v3/objects/contacts/search
    
    METHOD: ${method}
    
    HEADERS:
    - x-pica-secret: {{process.env.PICA_SECRET}}
    - x-pica-connection-key: {{process.env.PICA_${platform.toUpperCase()}_CONNECTION_KEY}}
    - x-pica-action-id: ${actionId}
    - ... (other headers)
    
    BODY: {{BODY}}
    
    QUERY PARAMS: {{QUERY_PARAMS}}`;
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It effectively discloses that this tool loads documentation into context (a behavioral trait), is mandatory before execution (a prerequisite), and helps understand requirements and caveats. However, it doesn't mention potential limitations like rate limits, error handling, or whether it's idempotent, leaving some behavioral aspects unspecified.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured in two sentences: the first states the purpose and scope, the second provides mandatory usage guidelines. Every phrase adds value—there's no redundancy, and critical information (the 'MUST' directive) is front-loaded for immediate visibility.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (pre-execution documentation loading with 2 required parameters) and lack of annotations/output schema, the description is largely complete. It covers purpose, mandatory usage, parameter sources, and workflow context. However, it doesn't describe the return format or what 'comprehensive documentation' entails, leaving some ambiguity about the output.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, providing detailed descriptions for both parameters. The description adds minimal value beyond the schema by reinforcing that action_id comes from get_pica_platform_actions and platform from list_pica_integrations, but doesn't explain parameter interactions or provide additional semantic context. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and resource 'comprehensive documentation for a specific action', specifying it includes parameters, requirements, and usage examples. It explicitly distinguishes from sibling tools by naming execute_pica_action as a tool that must be called after this one, and references get_pica_platform_actions and list_pica_integrations as sources for required parameters.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool: 'MUST call this tool before execute_pica_action' and 'required for successful execution.' It also specifies alternatives by referencing that action_id comes from get_pica_platform_actions and platform from list_pica_integrations, creating clear workflow dependencies.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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/withoneai/pica-mcp'

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