$npx -y skills add launchdarkly/ai-tooling --skill toolsGive your agents capabilities through tools (function calling). Helps you identify what your agent needs to do, create tool definitions, and attach them to config variations.
| 1 | # Config Tools |
| 2 | |
| 3 | You're using a skill that will guide you through adding capabilities to your agents through tools (function calling). Your job is to identify what your agent needs to do, create tool definitions, attach them to variations, and verify they work. |
| 4 | |
| 5 | ## Prerequisites |
| 6 | |
| 7 | This skill requires the remotely hosted LaunchDarkly MCP server to be configured in your environment. |
| 8 | |
| 9 | **Required MCP tools:** |
| 10 | - `create-ai-tool` -- create a new tool definition with a schema |
| 11 | - `update-ai-config-variation` -- attach tools to a config variation |
| 12 | - `get-ai-config` -- verify tools are attached to the variation |
| 13 | |
| 14 | **Optional MCP tools:** |
| 15 | - `list-ai-tools` -- browse existing tools in the project |
| 16 | - `get-ai-tool` -- inspect a specific tool's schema |
| 17 | |
| 18 | ## Core Principles |
| 19 | |
| 20 | 1. **Start with Capabilities**: Think about what your agent needs to do before creating tools |
| 21 | 2. **Framework Matters**: LangGraph/CrewAI often auto-generate schemas; OpenAI SDK needs manual schemas |
| 22 | 3. **Create Before Attach**: Tools must exist before you can attach them to variations |
| 23 | 4. **Verify**: The agent fetches the config to confirm attachment |
| 24 | 5. **Complete the Full Workflow**: Listing existing tools is a discovery step, not the end goal. After listing, always proceed to create the requested tool, attach it, and verify. Do not stop after exploration. |
| 25 | |
| 26 | ## Workflow |
| 27 | |
| 28 | ### Step 1: Identify Needed Capabilities |
| 29 | |
| 30 | What should the agent be able to do? |
| 31 | - Query databases, call APIs, perform calculations, send notifications |
| 32 | - Check what exists in the codebase (API clients, functions) |
| 33 | - Consider framework: LangGraph/LangChain auto-generate schemas; direct SDK needs manual schemas |
| 34 | |
| 35 | If the user asks to check existing tools first, or you have no codebase context about what tools exist, follow this exact order: |
| 36 | 1. `list-ai-tools` -- explore what exists |
| 37 | 2. `create-ai-tool` -- create the new tool (with a key different from existing ones) |
| 38 | 3. `update-ai-config-variation` -- attach it |
| 39 | 4. `get-ai-config` -- verify |
| 40 | |
| 41 | Call `list-ai-tools` as your **first** tool call before any creation. Never stop after listing alone -- always proceed through all four steps. |
| 42 | |
| 43 | ### Step 2: Create Tools |
| 44 | |
| 45 | Use `create-ai-tool` with: |
| 46 | - `key` -- unique identifier for the tool |
| 47 | - `description` -- clear description (the LLM uses this to decide when to call the tool) |
| 48 | - `schema` -- raw JSON Schema (do NOT use the OpenAI function calling wrapper): |
| 49 | |
| 50 | ```json |
| 51 | { |
| 52 | "type": "object", |
| 53 | "properties": { |
| 54 | "query": {"type": "string", "description": "Search query"}, |
| 55 | "limit": {"type": "integer", "default": 10} |
| 56 | }, |
| 57 | "required": ["query"] |
| 58 | } |
| 59 | ``` |
| 60 | |
| 61 | ### Step 3: Attach to Variation |
| 62 | |
| 63 | Use `update-ai-config-variation` to attach tools. **Pass only the `tools` field.** Do not bundle `instructions`, `messages`, `model`, or `parameters` into this PATCH unless the user has explicitly asked you to also update those fields. Those fields may have been edited in the LaunchDarkly UI since the variation was created, and including them in a tool-attachment PATCH will silently clobber the UI edits. |
| 64 | |
| 65 | ```json |
| 66 | { |
| 67 | "projectKey": "my-project", |
| 68 | "configKey": "support-chatbot", |
| 69 | "variationKey": "default", |
| 70 | "tools": [ |
| 71 | {"key": "search-knowledge-base", "version": 1} |
| 72 | ] |
| 73 | } |
| 74 | ``` |
| 75 | |
| 76 | If you observe a UI-clear bug where attaching tools wipes other fields, **do not work around it by re-sending those fields from the previous `get-ai-config` response** — that masks the bug and can resurrect stale values that the user has since edited. Report the bug instead. |
| 77 | |
| 78 | ### Step 4: Verify |
| 79 | |
| 80 | 1. Use `get-ai-tool` to confirm the tool exists with a valid schema |
| 81 | 2. Use `get-ai-config` to confirm the tool is attached to the variation (check `tools` in the variation's output) |
| 82 | |
| 83 | **Report results:** |
| 84 | - Tool created with valid schema |
| 85 | - Tool attached to variation |
| 86 | - Flag any issues |
| 87 | |
| 88 | ## Per-provider schema at the call site |
| 89 | |
| 90 | LaunchDarkly stores the tool schema once — the flat `{type, name, description, parameters}` shape you passed to `create-ai-tool`. Your application reads it back via `config.model.parameters.tools` (completion mode) or `agent_config.model.parameters.tools` (agent mode), then converts to the shape the provider SDK expects. LaunchDarkly never makes the provider call; your code does. The handlers that implement each tool also stay in application code — LaunchDarkly stores the schema, your application owns the behavior. |
| 91 | |
| 92 | | Provider / framework | Target shape | Where it goes on the call | |
| 93 | |---|---|---| |
| 94 | | OpenAI Chat Completions (direct SDK) | `{type: "function", function: {name, description, parameters}}` | top-level `tools=[...]` | |
| 95 | | Anthropic direct SDK | `{name, description, input_schema}` — rename `para |