Skip to main content
Glama
stier1ba

LicenseSpring MCP Server

by stier1ba

Add Consumption

add_consumption

Increase consumption units for a specific license by providing the license key, hardware ID, product, and consumption value. Manage overages and usage limits effectively with this tool.

Instructions

Add consumption units to a license

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
allow_overagesNo
consumptionsYes
hardware_idYes
license_keyYes
max_overagesNo
productYes

Implementation Reference

  • The handler function that implements the 'add_consumption' tool logic. It sends a POST request to the LicenseSpring License API endpoint '/api/v4/add_consumption' with the provided parameters and returns the API response or error.
    }, async ({ license_key, hardware_id, product, consumptions, max_overages, allow_overages }) => {
      try {
        const response = await apiClient.post('/api/v4/add_consumption', {
          license_key,
          hardware_id,
          product,
          consumptions,
          max_overages,
          allow_overages,
        });
        
        return {
          content: [{
            type: 'text',
            text: JSON.stringify(response.data, null, 2),
          }],
        };
      } catch (error) {
        return {
          content: [{
            type: 'text',
            text: `Error adding consumption: ${handleApiError(error)}`,
          }],
          isError: true,
        };
      }
  • Zod input schema validation for the 'add_consumption' tool parameters.
    inputSchema: {
      license_key: z.string().min(1, 'License key is required'),
      hardware_id: z.string().min(1, 'Hardware ID is required'),
      product: z.string().min(1, 'Product code is required'),
      consumptions: z.number().min(1, 'Consumption units must be positive'),
      max_overages: z.number().optional(),
      allow_overages: z.boolean().optional(),
    },
  • Registration of the 'add_consumption' MCP tool with schema and handler function.
    server.registerTool('add_consumption', {
      title: 'Add Consumption',
      description: 'Add consumption units to a license',
      inputSchema: {
        license_key: z.string().min(1, 'License key is required'),
        hardware_id: z.string().min(1, 'Hardware ID is required'),
        product: z.string().min(1, 'Product code is required'),
        consumptions: z.number().min(1, 'Consumption units must be positive'),
        max_overages: z.number().optional(),
        allow_overages: z.boolean().optional(),
      },
    }, async ({ license_key, hardware_id, product, consumptions, max_overages, allow_overages }) => {
      try {
        const response = await apiClient.post('/api/v4/add_consumption', {
          license_key,
          hardware_id,
          product,
          consumptions,
          max_overages,
          allow_overages,
        });
        
        return {
          content: [{
            type: 'text',
            text: JSON.stringify(response.data, null, 2),
          }],
        };
      } catch (error) {
        return {
          content: [{
            type: 'text',
            text: `Error adding consumption: ${handleApiError(error)}`,
          }],
          isError: true,
        };
      }
    });
  • TypeScript interface defining the request shape for add_consumption, used for typing the API client requests.
    export interface AddConsumptionRequest {
      license_key: string;
      hardware_id: string;
      product: string;
      consumptions: number;
      max_overages?: number;
      allow_overages?: boolean;
    }
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 implies a write operation ('Add'), but doesn't specify permissions required, whether changes are reversible, rate limits, or what happens on success/failure. This leaves critical behavioral traits undocumented for a mutation tool.

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, making it easy to parse. It's appropriately sized for conveying the core purpose without unnecessary elaboration.

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?

For a mutation tool with 6 parameters, 0% schema coverage, no annotations, and no output schema, the description is inadequate. It lacks details on behavior, parameters, and expected outcomes, leaving significant gaps for an agent to operate effectively.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate by explaining parameters, but it adds no semantic information beyond the tool name. Parameters like 'allow_overages' and 'max_overages' remain unexplained, leaving the agent to guess their purpose and usage.

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 action ('Add') and resource ('consumption units to a license'), making the purpose understandable. However, it doesn't distinguish this tool from sibling tools like 'add_feature_consumption', which might handle similar operations with different scopes or targets.

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, such as 'activate_license' or 'add_feature_consumption', nor does it mention prerequisites like license activation status. Without this context, an agent might struggle to select the correct tool in a workflow.

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/stier1ba/licensespring-mcp'

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