Skip to main content
Glama
mintlineai

Mintline MCP Server

by mintlineai

delete_tag

Delete a tag and remove it from all linked receipts and transactions.

Instructions

Delete tag. Delete a tag and remove it from all tagged items.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesTag ID

Implementation Reference

  • The response formatting handler for the 'delete_tag' tool. When the API call succeeds, it simply returns the string 'Tag deleted.' The actual deletion logic is delegated to an API call via executeAPICall (line 346) which uses the dynamically-generated pathMap to route to the correct API endpoint.
    case "delete_tag":
      return "Tag deleted.";
  • src/index.js:140-155 (registration)
    Dynamic tool registration via OpenAPI spec. The 'delete_tag' tool name is the operationId from the API spec, registered dynamically in the tools array and pathMap at lines 140-155. The tool definition (name, description, inputSchema) is fetched from the API and built on startup.
    tools.push({
      name: operationId,
      description: `${operation.summary}. ${operation.description || ""}`.trim(),
      inputSchema: {
        type: "object",
        properties,
        required: required.length > 0 ? required : undefined,
      },
    });
    
    pathMap[operationId] = {
      method: method.toUpperCase(),
      path,
      parameters: operation.parameters || [],
      hasBody: !!operation.requestBody,
    };
  • Input schema is dynamically generated from the OpenAPI spec parameters and requestBody for each operation, including 'delete_tag'. The schema properties and required fields are derived from the API spec's parameters and request body definitions.
    // Build input schema from parameters and requestBody
    const properties = {};
    const required = [];
    
    // Add parameters (path + query)
    if (operation.parameters) {
      for (const param of operation.parameters) {
        properties[param.name] = {
          type: param.schema?.type || "string",
          description: param.description,
          enum: param.schema?.enum,
          default: param.schema?.default,
        };
        if (param.required) {
          required.push(param.name);
        }
      }
    }
    
    // Add request body properties
    if (operation.requestBody?.content?.["application/json"]?.schema?.properties) {
      const bodyProps = operation.requestBody.content["application/json"].schema.properties;
      const bodyRequired = operation.requestBody.content["application/json"].schema.required || [];
      for (const [name, prop] of Object.entries(bodyProps)) {
        properties[name] = {
          type: prop.type || "string",
          description: prop.description,
          enum: prop.enum,
          default: prop.default,
        };
      }
      required.push(...bodyRequired);
    }
    
    tools.push({
      name: operationId,
      description: `${operation.summary}. ${operation.description || ""}`.trim(),
      inputSchema: {
        type: "object",
        properties,
        required: required.length > 0 ? required : undefined,
      },
  • The executeAPICall helper that performs the actual HTTP request for the delete_tag operation. It builds the URL with path parameters, adds query params, and sends the request with the proper method (e.g., DELETE) to the API endpoint defined in pathMap.
    async function executeAPICall(pathInfo, args) {
      const { method, path, parameters, hasBody } = pathInfo;
    
      // Build URL with path parameters replaced
      let url = `${BASE_URL}${path}`;
      const queryParams = new URLSearchParams();
    
      for (const param of parameters) {
        const value = args[param.name];
        if (value === undefined) continue;
    
        if (param.in === "path") {
          url = url.replace(`{${param.name}}`, encodeURIComponent(value));
        } else if (param.in === "query") {
          queryParams.set(param.name, value);
        }
      }
    
      const queryString = queryParams.toString();
      if (queryString) {
        url += `?${queryString}`;
      }
    
      // Build request body (exclude path/query params)
      let body = undefined;
      if (hasBody) {
        const bodyParams = {};
        const paramNames = new Set(parameters.map(p => p.name));
        for (const [key, value] of Object.entries(args)) {
          if (!paramNames.has(key) && value !== undefined) {
            bodyParams[key] = value;
          }
        }
        if (Object.keys(bodyParams).length > 0) {
          body = JSON.stringify(bodyParams);
        }
      }
    
      const response = await fetch(url, {
        method,
        headers: {
          "Authorization": `Bearer ${apiKey}`,
          "Content-Type": "application/json",
        },
        body,
      });
    
      let data;
      try {
        data = await response.json();
      } catch {
        throw new Error(`HTTP ${response.status}: ${response.statusText}`);
      }
    
      if (!data.success) {
        throw new Error(data.error?.message || `Request failed (${response.status})`);
      }
    
      return data;
    }
  • The CallToolRequestSchema handler that dispatches tool calls. When 'delete_tag' is called, it looks up the pathInfo from pathMap (line 336), calls executeAPICall (line 346) to make the HTTP request, then formats the response via formatResponse (line 347) which returns 'Tag deleted.'
      server.setRequestHandler(CallToolRequestSchema, async (request) => {
        const { name, arguments: args } = request.params;
        const pathInfo = pathMap[name];
    
        if (!pathInfo) {
          return {
            content: [{ type: "text", text: `Error: Unknown tool "${name}"` }],
            isError: true,
          };
        }
    
        try {
          const response = await executeAPICall(pathInfo, args || {});
          const formatted = formatResponse(name, response);
          return { content: [{ type: "text", text: formatted }] };
        } catch (error) {
          return {
            content: [{ type: "text", text: `Error: ${error.message}` }],
            isError: true,
          };
        }
      });
    
      const transport = new StdioServerTransport();
      await server.connect(transport);
      console.error("Mintline MCP server running");
    }
Behavior3/5

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

With no annotations, the description must carry the behavioral burden. It discloses the cascading effect (removing from all tagged items), implying irreversibility. However, it does not mention idempotency, error cases, or required permissions. Adequate but not exhaustive.

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?

Two short sentences with no superfluous information. Every word earns its place. Exceptionally concise.

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 simplicity (one parameter, no output schema), the description covers the essential behavior. It could mention the return value or success indication, but this is a minor gap for such a straightforward 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?

Schema coverage is 100% (the single parameter 'id' is fully described as 'Tag ID'). The description does not add any further meaning, such as format, source, or constraints. Baseline 3 is appropriate.

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 action (delete a tag) and the resource (tag), with an explicit scope: 'remove it from all tagged items'. It distinguishes from sibling tools like create_tag or list_tags.

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 on when to use this tool versus alternatives, no prerequisites, and no mention of consequences like irreversibility or permission requirements. The agent is left without context for proper invocation.

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/mintlineai/mintline-mcp'

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