Skip to main content
Glama
mohit-novo

Lithic MCP Server

by mohit-novo

get_resource

Retrieve specific Lithic banking resources like cards, accounts, or transactions by providing the resource type and ID.

Instructions

Get a specific Lithic resource by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
resourceTypeYesType of resource (card, account, transaction, etc.)
resourceIdYesID/token of the resource to fetch

Implementation Reference

  • The handler logic for the 'get_resource' tool. It validates the input arguments using Zod, maps the resource type to the appropriate Lithic API endpoint, fetches the specific resource by ID using axios, and returns the JSON response or an error message.
    if (request.params.name === "get_resource") {
      try {
        // Parse and validate arguments
        const args = z.object({
          resourceType: resourceTypeSchema,
          resourceId: resourceIdSchema
        }).parse(request.params.arguments);
    
        // Map to standardized resource type
        const standardizedResourceType = RESOURCE_MAP[args.resourceType.toLowerCase()] || args.resourceType;
        
        // Map resource type to endpoint
        const endpoint = mapResourceTypeToEndpoint(standardizedResourceType);
        const response = await lithicApi.get(`${endpoint}/${args.resourceId}`);
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(response.data, null, 2)
            }
          ]
        };
      } catch (error: any) {
        console.error(`Error fetching resource:`, error.message);
    
        return {
          isError: true,
          content: [
            {
              type: "text",
              text: `Error fetching resource: ${error.message}`
            }
          ]
        };
      }
  • JSON Schema definition for the 'get_resource' tool input parameters, specifying resourceType and resourceId as required strings.
    inputSchema: {
      type: "object",
      properties: {
        resourceType: {
          type: "string",
          description: "Type of resource (card, account, transaction, etc.)"
        },
        resourceId: {
          type: "string",
          description: "ID/token of the resource to fetch"
        }
      },
      required: ["resourceType", "resourceId"]
    }
  • src/index.ts:82-99 (registration)
    Registration of the 'get_resource' tool in the ListToolsRequestSchema handler, including name, description, and input schema.
    {
      name: "get_resource",
      description: "Get a specific Lithic resource by ID",
      inputSchema: {
        type: "object",
        properties: {
          resourceType: {
            type: "string",
            description: "Type of resource (card, account, transaction, etc.)"
          },
          resourceId: {
            type: "string",
            description: "ID/token of the resource to fetch"
          }
        },
        required: ["resourceType", "resourceId"]
      }
    },
  • Helper function that maps a resource type string to the corresponding Lithic API endpoint path, used in the get_resource handler.
    function mapResourceTypeToEndpoint(resourceType: string): string {
      switch (resourceType) {
        case 'card':
          return '/cards';
        case 'account':
          return '/accounts';
        case 'financial_account':
          return '/financial_accounts';
        case 'transaction':
          return '/transactions';
        case 'external_bank_account':
          return '/external_bank_accounts';
        case 'event':
          return '/events';
        case 'balance':
          return '/balances';
        case 'card_program':
          return '/card_programs';
        case 'dispute':
          return '/disputes';
        case 'report':
          return '/reports';
        case 'webhook':
          return '/webhooks';
        case 'account_holder':
          return '/account_holders';
        default:
          return `/${resourceType}s`; // Default to pluralizing the resource type
      }
    }
  • Mapping object for standardizing various resource type aliases to canonical Lithic API resource types, used in get_resource and list_resources handlers.
    const RESOURCE_MAP: Record<string, string> = {
      'card': 'card',
      'account': 'account',
      'financial_account': 'financial_account',
      'financial-account': 'financial_account',
      'credit': 'financial_account',
      'credit-account': 'financial_account',
      'transaction': 'transaction',
      'event': 'event',
      'balance': 'balance',
      'dispute': 'dispute',
      'bank': 'external_bank_account',
      'bank-account': 'external_bank_account',
      'external_bank_account': 'external_bank_account',
      'report': 'report',
      'webhook': 'webhook',
      'card_program': 'card_program',
      'account_holder': 'account_holder'
    };
Behavior2/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 of behavioral disclosure. It states 'Get' which implies a read operation, but doesn't clarify permissions needed, rate limits, error handling, or what happens if the resource doesn't exist. For a tool with zero annotation coverage, this is a significant gap in transparency.

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 a single, efficient sentence with no wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly.

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

Completeness2/5

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

Given the complexity of fetching a resource by ID (which involves potential errors like not found), no annotations, and no output schema, the description is incomplete. It lacks details on return values, error conditions, or behavioral nuances, making it inadequate for a tool that likely requires more context for reliable use.

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%, so the schema already documents both parameters ('resourceType' and 'resourceId') with clear descriptions. The description adds no additional meaning beyond what's in the schema, such as examples or constraints, but the baseline is 3 since the schema does the heavy lifting.

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

Purpose4/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 ('a specific Lithic resource by ID'), making the purpose understandable. However, it doesn't explicitly differentiate from its sibling 'list_resources' beyond the singular vs. plural naming, which could be more explicit about the distinction between retrieving a single item versus listing multiple items.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention the sibling 'list_resources' or any other tools, nor does it specify prerequisites, contexts, or exclusions for usage, leaving the agent to infer based on the name alone.

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

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/mohit-novo/mcp-lithic'

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