create_tag
Create a new tag to categorize and organize your financial transactions and receipts in Mintline.
Instructions
Create tag. Create a new tag.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Tag name | |
| color | No | Tag color (hex code, e.g., #10b981) |
Implementation Reference
- src/index.js:285-286 (handler)The handler for `create_tag` - formats the API response when a tag is created. This is part of the `formatResponse` function that maps API responses to human-readable text. The actual API execution is done by `executeAPICall` which dynamically resolves the endpoint from the OpenAPI spec.
case "create_tag": return `Tag created: ${data.name} (${data.id})`; - src/index.js:333-334 (registration)Tool registration - the `CallToolRequestSchema` handler dispatches all tools dynamically. The `pathMap` is built from the OpenAPI spec (line 150-156) and `formatResponse` handles the `create_tag` case at line 285.
server.setRequestHandler(CallToolRequestSchema, async (request) => { - src/index.js:97-160 (helper)Helper function that generates the tool definitions and path map from the OpenAPI spec. The `create_tag` tool is dynamically generated from the API spec - its operationId, parameters, and request body schema are parsed here.
function generateToolsFromOpenAPI(spec) { const tools = []; const pathMap = {}; // operationId -> { method, path, parameters, requestBody } for (const [path, methods] of Object.entries(spec.paths)) { for (const [method, operation] of Object.entries(methods)) { const operationId = operation.operationId; if (!operationId) continue; // 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, }, }); pathMap[operationId] = { method: method.toUpperCase(), path, parameters: operation.parameters || [], hasBody: !!operation.requestBody, }; } } return { tools, pathMap }; }