بنقرة واحدة
add-tool
Add a new MCP tool (or extend an existing one) in the NiCE Cognigy Plugin's MCP server
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Add a new MCP tool (or extend an existing one) in the NiCE Cognigy Plugin's MCP server
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Use when adding custom logic inside a Cognigy tool branch with manage_flow_nodes — supported node types, config schemas, placement rules, and the tool-first workflow.
Use when the user wants to add xApps to a Cognigy flow — interactive HTML / Adaptive Card mini-apps rendered to the user, with the submitted data flowing back into the conversation. Covers the xApp flow nodes, the Init Session rule, and accessing xApp data.
Use when the user wants to build, create, or set up a new Cognigy AI Agent from scratch — covers listing projects, ensuring an LLM exists, creating the agent, testing it, and refining persona/job fields.
Use when the user wants to add knowledge, RAG, or a knowledge store/source to a Cognigy agent — covers embedding vs Knowledge Search models, Knowledge AI settings, ingesting sources, and attaching knowledge as a tool.
Use when configuring or choosing an LLM for a Cognigy agent — valid provider names (openAI, anthropic, azureOpenAI, google, mistral), model strings, connection types, and credential resolution.
Use when exporting, importing, uploading, inspecting, or downloading Cognigy package zip files — including reusing an LLM plus its connection across projects.
| name | add-tool |
| description | Add a new MCP tool (or extend an existing one) in the NiCE Cognigy Plugin's MCP server |
Add a new MCP tool (or extend an existing one) in the NiCE Cognigy Plugin's MCP server. The user will describe the tool's purpose, operations, and Cognigy API endpoints it should call.
Skills come first. The plugin's user-facing surface is its skills — each describes a workflow and auto-loads on intent. Tools are the execution primitives a skill orchestrates. Work skill-first: figure out which workflow the capability belongs to, then add or extend a tool only where that workflow needs it. There is no one-skill-per-tool rule — many tools can serve a single workflow, and a new tool usually just slots into an existing skill.
This is a TypeScript MCP server. Tools follow a strict pattern across these files:
| File | Role |
|---|---|
src/tools/definitions.ts | Tool metadata: name, description, annotations, inputSchema (JSON Schema) |
src/schemas/tools.ts | Zod validation schemas — one per tool or discriminated union per multi-op tool |
src/tools/handlers.ts | ToolHandlers class — one handleXxx(args) method per tool + a case in handleToolCall() |
plugin/skills/<name>/SKILL.md | Hand-authored plugin skill for the tool (auto-loads on intent in supporting clients, e.g. Claude Code) |
src/__tests__/schemas.test.ts | Schema validation tests |
src/__tests__/tools.test.ts | Handler tests with mocked CognigyApiClient |
This server deliberately uses few tools (~16) to cover many Cognigy API endpoints (~115). Each tool groups related endpoints under a single operation parameter that acts as a router.
Example: manage_knowledge — one tool covers ~8 endpoints:
create_store → POST /v2.0/knowledgestorescreate_source → POST /v2.0/knowledgestores/{id}/sourceslist_sources → GET /v2.0/knowledgestores/{id}/sourcesingest_source → POST /v2.0/knowledgestores/{id}/sources/{id}/ingestlist_chunks → GET /v2.0/knowledgestores/{id}/chunksWhy this pattern:
projectId) and the description explains the full workflow across operations in one place.When to create a new tool vs. add an operation to an existing tool:
Reference templates are bundled with this skill. Use them as starting points:
${CLAUDE_SKILL_DIR}/templates/definition.ts — Tool definition entry for src/tools/definitions.ts${CLAUDE_SKILL_DIR}/templates/schema.ts — Zod schema for src/schemas/tools.ts${CLAUDE_SKILL_DIR}/templates/handler.ts — Handler method for src/tools/handlers.tsRead these templates before writing code to match the exact conventions.
Before writing code, confirm with the user:
manage_packages)src/tools/definitions.ts and src/schemas/tools.ts to match conventionssrc/tools/definitions.ts)Read ${CLAUDE_SKILL_DIR}/templates/definition.ts for the template.
Add an entry to the tools array. Conventions:
src/schemas/tools.ts)Read ${CLAUDE_SKILL_DIR}/templates/schema.ts for the template.
z.object()z.discriminatedUnion("operation", [...])idSchema is already defined: z.string().regex(/^[a-f0-9]{24}$/)src/tools/handlers.ts)Read ${CLAUDE_SKILL_DIR}/templates/handler.ts for the template.
Add a method to the ToolHandlers class, then add the dispatch case in handleToolCall().
Key patterns:
this.apiClient.get/post/patch/delete/put/uploadFile for API callsfilterResponse(resourceType, result) to return summary viewswithHints(data, { action: "helpful suggestion" }) for actionable errorssrc/tools/ (e.g. packageImport.ts)Skills — not tools — are how users reach this capability, so connect the new tool to a workflow:
plugin/skills/<id>/SKILL.md so its steps use the new tool. Do NOT create a new skill just because you added a tool.plugin/skills/<id>/SKILL.md with name/description frontmatter (the description is the auto-load trigger) followed by the workflow body. There is no registry step; it auto-loads on intent in supporting clients (e.g. Claude Code).Schema tests in src/__tests__/schemas.test.ts:
Handler tests in src/__tests__/tools.test.ts:
CognigyApiClient methods (jest.fn())describe/it blocksRun in order:
npx tsc -p tsconfig.json --noEmit — type checknpm test -- --runInBand — all tests passnpx prettier --write <changed-files> — format only the files you created or modifiedidSchema (24-char hex)handle<PascalCaseName> (e.g. handleManagePackages)this.apiClient.uploadFile() — see manage_packages handler for the patternREADME.md tool count and table if adding a brand new tool