Skip to main content
Glama
lindoai

mcp-lindoai

Official

allocate_credits

Allocate credits to a client by specifying client ID, credit type, and amount. Optionally add source and notes for tracking.

Instructions

Allocate credits to a client.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
client_idYesClient ID
credit_typeYesCredit type
amountYesNumber of credits
sourceNoSource (e.g. bonus)
notesNoNotes

Implementation Reference

  • Registration of the 'allocate_credits' tool via server.tool() with name, description, schema, metadata, and handler callback.
    server.tool(
      "allocate_credits",
      "Allocate credits to a client.",
      {
        client_id: z.string().describe("Client ID"),
        credit_type: z.enum(["monthly", "purchased", "daily"]).describe("Credit type"),
        amount: z.number().describe("Number of credits"),
        source: z.string().optional().describe("Source (e.g. bonus)"),
        notes: z.string().optional().describe("Notes"),
      },
      { title: "Allocate Credits", readOnlyHint: false, destructiveHint: false, openWorldHint: false },
      async ({ client_id, credit_type, amount, source, notes }) => {
        const body = { client_id, credit_type, amount };
        if (source) body.source = source;
        if (notes) body.notes = notes;
        const data = await apiCall("/v1/ai/credits/client/allocate", "POST", body);
        return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
      }
    );
  • Handler function that builds the request body (client_id, credit_type, amount, optional source/notes) and calls POST /v1/ai/credits/client/allocate.
    async ({ client_id, credit_type, amount, source, notes }) => {
      const body = { client_id, credit_type, amount };
      if (source) body.source = source;
      if (notes) body.notes = notes;
      const data = await apiCall("/v1/ai/credits/client/allocate", "POST", body);
      return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
    }
  • Zod schema defining inputs: client_id (string), credit_type (enum: monthly/purchased/daily), amount (number), source (optional string), notes (optional string).
    {
      client_id: z.string().describe("Client ID"),
      credit_type: z.enum(["monthly", "purchased", "daily"]).describe("Credit type"),
      amount: z.number().describe("Number of credits"),
      source: z.string().optional().describe("Source (e.g. bonus)"),
      notes: z.string().optional().describe("Notes"),
    },
  • The apiCall helper function used by the handler to make authenticated HTTP requests to the Lindo AI API.
    async function apiCall(path, method, body) {
      const url = `${BASE_URL}${path}`;
      const res = await fetch(url, {
        method,
        headers: {
          Authorization: `Bearer ${API_KEY}`,
          "Content-Type": "application/json",
        },
        ...(body ? { body: JSON.stringify(body) } : {}),
      });
      return res.json();
    }
Behavior2/5

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

Annotations show this is a non-read-only, non-destructive operation, but the description adds no further behavioral context (e.g., whether allocation is additive or overwrites, permission requirements, or side effects). With annotations present, the description should enhance transparency, but it merely restates the function name.

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

Conciseness4/5

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

The description is a single, concise sentence that is front-loaded and to the point. While very short, it wastes no words and effectively communicates the core action.

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 tool has 5 parameters, no output schema, and is a mutation operation, the description is too minimal. It omits return value, prerequisites (e.g., client existence), or how the behavior varies by credit_type. A more complete description would help the agent understand the full scope of the operation.

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?

The input schema covers 100% of parameters with descriptions, so the schema already provides meaning. The description does not elaborate on any parameter, giving no added value beyond the schema. Baseline 3 is appropriate.

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 'Allocate credits to a client.' uses a specific verb 'allocate' and identifies the resource 'credits' and recipient 'client,' clearly distinguishing from siblings like 'get_credits' or 'get_client_credits.' However, it could be more precise about the operation (e.g., additive vs. setting).

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?

No guidance is provided on when to use this tool versus alternatives like 'get_client_credits' for checking balances, nor are there any context or scenario hints. The description offers no usage exclusions or prerequisites.

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/lindoai/mcp-server'

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