Skip to main content
Glama
devlimelabs

Lulu Print MCP Server

by devlimelabs

calculate-print-job-cost

Calculate print job costs for Lulu Print products by entering product ID and quantity to estimate expenses before creating the job.

Instructions

Calculate the cost of a print job without creating it

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
product_idYesLulu product ID
quantityYesNumber of copies

Implementation Reference

  • The handler function implementing the calculate-print-job-cost tool logic with mock cost calculation.
    async ({ product_id, quantity }) => {
      try {
        // TODO: Implement actual calculation with API
        const mockCost = {
          product_id,
          quantity,
          unit_cost: 10.99,
          total_cost: 10.99 * quantity,
          currency: "USD",
          message: "This is a mock calculation - actual API integration pending"
        };
        
        return {
          content: [{
            type: "text" as const,
            text: JSON.stringify(mockCost, null, 2)
          }]
        };
      } catch (error: any) {
        return {
          content: [{
            type: "text" as const,
            text: `Error: ${error.message}`
          }],
          isError: true
        };
      }
    }
  • Zod schema defining input parameters for the calculate-print-job-cost tool.
    {
      product_id: z.string().describe("Lulu product ID"),
      quantity: z.number().int().positive().describe("Number of copies")
    },
  • src/server.ts:19-54 (registration)
    Registration of the calculate-print-job-cost tool on the MCP server instance.
    server.tool(
      "calculate-print-job-cost",
      "Calculate the cost of a print job without creating it",
      {
        product_id: z.string().describe("Lulu product ID"),
        quantity: z.number().int().positive().describe("Number of copies")
      },
      async ({ product_id, quantity }) => {
        try {
          // TODO: Implement actual calculation with API
          const mockCost = {
            product_id,
            quantity,
            unit_cost: 10.99,
            total_cost: 10.99 * quantity,
            currency: "USD",
            message: "This is a mock calculation - actual API integration pending"
          };
          
          return {
            content: [{
              type: "text" as const,
              text: JSON.stringify(mockCost, null, 2)
            }]
          };
        } catch (error: any) {
          return {
            content: [{
              type: "text" as const,
              text: `Error: ${error.message}`
            }],
            isError: true
          };
        }
      }
    );
Behavior3/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It clearly indicates this is a read-only calculation tool (not creating anything), which is helpful. However, it doesn't mention potential limitations like rate limits, authentication requirements, or what specific cost components are included in the calculation.

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 that communicates the essential purpose without any wasted words. It's appropriately sized for a simple calculation tool and front-loads the key information.

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

Completeness3/5

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

For a 2-parameter calculation tool with no annotations and no output schema, the description provides adequate but minimal context. It clearly states the purpose but doesn't explain what the output looks like (cost format, currency, breakdown) or any prerequisites for successful calculation.

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 fully documents both parameters. The description doesn't add any additional meaning or context about the parameters beyond what's in the schema. This meets the baseline expectation when schema coverage is complete.

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 specific action ('calculate the cost') and resource ('print job'), and explicitly distinguishes it from the alternative action of creating a print job. This provides excellent clarity about what the tool does and what it doesn't do.

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

Usage Guidelines4/5

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

The description provides clear context about when to use this tool ('without creating it'), which implicitly suggests it's for cost estimation before actual creation. However, it doesn't explicitly mention when NOT to use it or provide specific alternatives beyond the implied contrast with creation tools.

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/devlimelabs/lulu-print-mcp'

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