Skip to main content
Glama

update_ingredient

Modify existing ingredient details in Inflow inventory including name, SKU, description, status, and custom fields using the product ID.

Instructions

Update an existing ingredient/product in Inflow inventory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
additionalFieldsNoAny additional fields to update
descriptionNoNew description
isActiveNoActive status
nameNoNew product name
productIdYesThe product ID to update
skuNoNew SKU code

Implementation Reference

  • Handler function updateProduct that constructs the update payload from args and delegates to InflowClient.upsertProduct for the actual API update.
    async updateProduct(client, args) { if (!args.productId) { return { success: false, error: 'productId is required' }; } // Build update object with only provided fields const updates = { productId: args.productId }; if (args.name !== undefined) updates.name = args.name; if (args.sku !== undefined) updates.sku = args.sku; if (args.description !== undefined) updates.description = args.description; if (args.isActive !== undefined) updates.isActive = args.isActive; // Merge any additional fields if (args.additionalFields) { Object.assign(updates, args.additionalFields); } return await client.upsertProduct(updates); }
  • index.js:181-205 (registration)
    Registration of the 'update_ingredient' MCP tool, including input schema and handler invocation.
    server.registerTool( 'update_ingredient', { description: 'Update an existing ingredient/product in Inflow inventory', inputSchema: { productId: z.string().describe('The product ID to update'), name: z.string().optional().describe('New product name'), sku: z.string().optional().describe('New SKU code'), description: z.string().optional().describe('New description'), isActive: z.boolean().optional().describe('Active status'), additionalFields: z.record(z.any()).optional().describe('Any additional fields to update') } }, async (args) => { const result = await productHandlers.updateProduct(inflowClient, args); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; } );
  • Core API implementation in InflowClient.upsertProduct that sends PUT request to /products endpoint to update the ingredient/product.
    async upsertProduct(product) { try { if (!product.productId) { return { success: false, error: 'productId is required for upsert' }; } const response = await this.client.put( `/${this.config.companyId}/products`, product ); return { success: true, data: response.data }; } catch (error) { return this._handleError(error, 'upsertProduct'); } }
  • Zod input schema defining parameters for the update_ingredient tool.
    productId: z.string().describe('The product ID to update'), name: z.string().optional().describe('New product name'), sku: z.string().optional().describe('New SKU code'), description: z.string().optional().describe('New description'), isActive: z.boolean().optional().describe('Active status'), additionalFields: z.record(z.any()).optional().describe('Any additional fields to update') }

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/intelligent-staffing-systems/mcp-inflow-ingredients'

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