searchProducts
Find products in ZenTao project management system by keyword to quickly locate relevant items for tracking and management tasks.
Instructions
Search products by keyword; returns a short list of products.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keyword | No | Keyword to match product name | |
| limit | No | Max items |
Implementation Reference
- src/zentao-mcp-server.js:590-601 (handler)Handler function that destructures arguments, calls the listProducts helper, and returns the products as JSON in the MCP response format.if (name === "searchProducts") { const { keyword, limit } = args; const products = await listProducts({ keyword, limit }); return { content: [ { type: "text", text: JSON.stringify({ products }, null, 2), }, ], }; }
- src/zentao-mcp-server.js:427-440 (registration)Tool registration in the listTools response, including name, description, and input schema.{ name: "searchProducts", description: "Search products by keyword; returns a short list of products.", inputSchema: { type: "object", properties: { keyword: { type: "string", description: "Keyword to match product name" }, limit: { type: "number", description: "Max items", default: 20 }, }, required: [], additionalProperties: false, }, }, {
- src/zentao-mcp-server.js:430-439 (schema)Input schema defining parameters for keyword and optional limit.inputSchema: { type: "object", properties: { keyword: { type: "string", description: "Keyword to match product name" }, limit: { type: "number", description: "Max items", default: 20 }, }, required: [], additionalProperties: false, }, },
- src/zentao-mcp-server.js:210-222 (helper)Core helper function that fetches products from ZenTao API, filters by keyword if provided, and limits results.async function listProducts({ keyword, limit = 20 } = {}) { const res = await callZenTao({ path: "products", query: { page: 1, limit, keywords: keyword }, }); const products = extractArray(res.data, ["products"]); const filtered = keyword ? products.filter((p) => `${p.name || ""}`.toLowerCase().includes(keyword.toLowerCase()) ) : products; return filtered.slice(0, limit); }