شعار Add Tool

Add Tool

مؤسسة
Cognigy
add-tool

Add a new MCP tool (or extend an existing one) in the NiCE Cognigy Plugin's MCP server

نظرة عامة

الناشرCognigy
المستودعcognigy-plugin
اسم المهارةadd-tool
النجوم
20
التفريعات
14
الملفات المرفقة
3
الترخيصMIT
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • الملفات المرفقة: 3

    نصوص برمجية وقوالب ومراجع يمكن للنموذج قراءتها أثناء عمله. الملفات للقراءة فقط ولا تُنفّذ أبدًا.

  • مفتوحة المصدر

    نشرها Cognigy على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Add Tool في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى «الإضافات» ثم «المهارات».
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/Cognigy/cognigy-plugin/tree/main/.claude/skills/add-tool
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات ← المهارات ← إضافة مهارة ← من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق Agent Skills استخدام هذه المهارة — انسخ المجلد إلى مجلد المهارات الخاص بذلك الوكيل.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Cognigy/cognigy-plugin.git /tmp/cognigy-plugin
mkdir -p .claude/skills
cp -r /tmp/cognigy-plugin/.claude/skills/add-tool .claude/skills/add-tool
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل Add Tool في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج مهارة Add Tool تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط Add Tool بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تستهلك تعليمات المهارة أي توكنات ما دامت المهارة غير مستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

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.

Context

This is a TypeScript MCP server. Tools follow a strict pattern across these files:

FileRole
src/tools/definitions.tsTool metadata: name, description, annotations, inputSchema (JSON Schema)
src/schemas/tools.tsZod validation schemas — one per tool or discriminated union per multi-op tool
src/tools/handlers.tsToolHandlers class — one handleXxx(args) method per tool + a case in handleToolCall()
plugin/skills/<name>/SKILL.mdHand-authored plugin skill for the tool (auto-loads on intent in supporting clients, e.g. Claude Code)
src/__tests__/schemas.test.tsSchema validation tests
src/__tests__/tools.test.tsHandler tests with mocked CognigyApiClient

Design philosophy: few tools, many operations

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/knowledgestores
  • create_source → POST /v2.0/knowledgestores/{id}/sources
  • list_sources → GET /v2.0/knowledgestores/{id}/sources
  • ingest_source → POST /v2.0/knowledgestores/{id}/sources/{id}/ingest
  • list_chunks → GET /v2.0/knowledgestores/{id}/chunks
  • etc.

Why this pattern:

  • Fewer tools for the LLM to choose from — 16 tools is much easier for Claude to reason about than 115 separate ones. Less confusion, better tool selection.
  • Grouped by domain — each tool maps to a Cognigy domain concept (knowledge, packages, webchat, flow nodes), making it intuitive.
  • Shared context — operations within a tool share parameters (like 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:

  • If the new functionality belongs to an existing domain (e.g. a new knowledge operation), add it as an operation to the existing tool.
  • If it represents a new domain concept, create a new tool.
  • Aim for each tool to average ~5-10 operations.

Templates

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.ts

Read these templates before writing code to match the exact conventions.

Steps

1. Gather requirements

Before writing code, confirm with the user:

  • Tool name (snake_case, e.g. manage_packages)
  • Operations (if multi-operation tool) and their required/optional params
  • Which Cognigy REST API endpoints each operation calls (method + path)
  • Whether a plugin skill is needed for the tool's workflow
  • Read existing tools in src/tools/definitions.ts and src/schemas/tools.ts to match conventions

2. Add the tool definition (src/tools/definitions.ts)

Read ${CLAUDE_SKILL_DIR}/templates/definition.ts for the template.

Add an entry to the tools array. Conventions:

  • Use 24-char hex IDs for all Cognigy resource IDs
  • The description is a contract, not a workflow: 3-6 sentences, at most 1000 chars — what the tool does, what it does not do (and which sibling tool does), one clause per operation, what it returns, any irreversibility. No numbered procedures, precondition checklists, "after this call X" or response-presentation rules: those go into the skill (step 5) or into a withHints action on the result, which fires exactly when it is relevant and works in every client.
  • Field descriptions: meaning, range, default, example — at most 450 chars. Put enum meaning in the description; the allowed values are already in enum. Runtime gotchas that only matter when filling one field (e.g. the Code-node input.httprequest shape) belong on that field.
  • src/__tests__/toolSurfaceBudget.test.ts enforces these caps plus a total definitions budget and a cap on src/instructions.ts. If it fails, move prose out rather than raising the cap.

3. Add Zod schema (src/schemas/tools.ts)

Read ${CLAUDE_SKILL_DIR}/templates/schema.ts for the template.

  • Single-operation tools use a plain z.object()
  • Multi-operation tools use z.discriminatedUnion("operation", [...])
  • The shared idSchema is already defined: z.string().regex(/^[a-f0-9]{24}$/)

4. Implement the handler (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:

  • Always parse args with the Zod schema first
  • Use this.apiClient.get/post/patch/delete/put/uploadFile for API calls
  • Use filterResponse(resourceType, result) to return summary views
  • Use withHints(data, { action: "helpful suggestion" }) for actionable errors
  • Complex logic (preview generation, conflict resolution) goes in a separate file under src/tools/ (e.g. packageImport.ts)

5. Wire the tool into a skill

Skills — not tools — are how users reach this capability, so connect the new tool to a workflow:

  • Existing workflow (most common) — extend the relevant plugin/skills/<id>/SKILL.md so its steps use the new tool. Do NOT create a new skill just because you added a tool.
  • New workflow / intent — only then create 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).

6. Add tests

Schema tests in src/__tests__/schemas.test.ts:

  • Valid input passes parsing
  • Missing required fields throw
  • Invalid IDs throw
  • Each operation variant is tested

Handler tests in src/__tests__/tools.test.ts:

  • Mock CognigyApiClient methods (jest.fn())
  • Test each operation calls correct API endpoints
  • Test error cases and edge cases
  • Follow existing test structure with describe/it blocks

7. Verify

Run in order:

  1. npx tsc -p tsconfig.json --noEmit — type check
  2. npm test -- --runInBand — all tests pass
  3. npx prettier --write <changed-files> — format only the files you created or modified

Guidelines

  • Match the style and conventions of existing tools exactly
  • Do NOT add unnecessary complexity — keep operations focused
  • Every Cognigy ID parameter should validate with idSchema (24-char hex)
  • Multi-operation tools should use discriminated unions (both in JSON Schema and Zod)
  • Handler methods should be named handle<PascalCaseName> (e.g. handleManagePackages)
  • If a tool needs file uploads, use this.apiClient.uploadFile() — see manage_packages handler for the pattern
  • Update README.md tool count and table if adding a brand new tool

الملفات المرفقة

يقرأ النموذج هذه الملفات عند الحاجة ما دامت المهارة محمّلة. وهي متاحة للقراءة ولا تُنفّذ أبدًا.

الأسئلة الشائعة

ماذا تفعل مهارة الذكاء الاصطناعي Add Tool؟

Add a new MCP tool (or extend an existing one) in the NiCE Cognigy Plugin's MCP server

لماذا تستخدم Add Tool على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة Add Tool عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت Add Tool في TypingMind؟

في TypingMind، افتح «الإضافات»، ثم «المهارات»، ثم اختر «التثبيت من GitHub» والصق https://github.com/Cognigy/cognigy-plugin/tree/main/.claude/skills/add-tool. يقرأ TypingMind ملف SKILL.md الخاص بالمهارة، ويجمع ملفاتها ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Add Tool؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Add Tool؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Add Tool معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Add Tool مجانية؟

نعم. نشرها Cognigy على GitHub بموجب ترخيص MIT. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا الإخبارية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇