tools
Give 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.
launchdarkly · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add launchdarkly/ai-tooling --skill tools技能说明
name: tools description: "Give 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." license: Apache-2.0 compatibility: Requires the remotely hosted LaunchDarkly MCP server metadata: author: launchdarkly version: "1.0.0-experimental"
Config Tools
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.
Prerequisites
This skill requires the remotely hosted LaunchDarkly MCP server to be configured in your environment.
Required MCP tools:
create-ai-tool-- create a new tool definition with a schemaupdate-ai-config-variation-- attach tools to a config variationget-ai-config-- verify tools are attached to the variation
Optional MCP tools:
list-ai-tools-- browse existing tools in the projectget-ai-tool-- inspect a specific tool's schema
Core Principles
- Start with Capabilities: Think about what your agent needs to do before creating tools
- Framework Matters: LangGraph/CrewAI often auto-generate schemas; OpenAI SDK needs manual schemas
- Create Before Attach: Tools must exist before you can attach them to variations
- Verify: The agent fetches the config to confirm attachment
- 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.
Workflow
Step 1: Identify Needed Capabilities
What should the agent be able to do?
- Query databases, call APIs, perform calculations, send notifications
- Check what exists in the codebase (API clients, functions)
- Consider framework: LangGraph/LangChain auto-generate schemas; direct SDK needs manual schemas
If the user asks to check existing tools first, or you have no codebase context about what tools exist, follow this exact order:
list-ai-tools-- explore what existscreate-ai-tool-- create the new tool (with a key different from existing ones)update-ai-config-variation-- attach itget-ai-config-- verify
Call list-ai-tools as your first tool call before any creation. Never stop after listing alone -- always proceed through all four steps.
Step 2: Create Tools
Use create-ai-tool with:
key-- unique identifier for the tooldescription-- clear description (the LLM uses this to decide when to call the tool)schema-- raw JSON Schema (do NOT use the OpenAI function calling wrapper):
{
"type": "object",
"properties": {
"query": {"type": "string", "description": "Search query"},
"limit": {"type": "integer", "default": 10}
},
"required": ["query"]
}
Step 3: Attach to Variation
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.
{
"projectKey": "my-project",
"configKey": "support-chatbot",
"variationKey": "default",
"tools": [
{"key": "search-knowledge-base", "version": 1}
]
}
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.
Step 4: Verify
- Use
get-ai-toolto confirm the tool exists with a valid schema - Use
get-ai-configto confirm the tool is attached to the variation (checktoolsin the variation's output)
Report results:
- Tool created with valid schema
- Tool attached to variation
- Flag any issues
Per-provider schema at the call site
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.
| Provider / framework | Target shape | Where it goes on the call |
|---|---|---|
| OpenAI Chat Completions (direct SDK) | {type: "function", function: {name, description, parameters}} | top-level tools=[...] |
| Anthropic direct SDK | {name, description, input_schema} — rename parameters → input_schema | top-level tools=[...] |
| Bedrock Converse | {toolSpec: {name, description, inputSchema: {json: parameters}}} | inside toolConfig.tools=[...] |
Gemini (google-genai) | {function_declarations: [{name, description, parameters}]} (Python) / {functionDeclarations: [...]} (Node) | GenerateContentConfig.tools=[...] |
| OpenAI Responses API | LaunchDarkly's flat shape passes through unchanged | top-level tools=[...] |
| LangChain / LangGraph | createLangChainModel(config) (Node) / create_langchain_model(config) (Python) and pass ai_config.tools (or your own StructuredTool list) into bind_tools(...) / create_react_agent(tools=[...]) | framework-native; no per-call conversion |
| Strands Agents | LaunchDarkly's flat shape; drop parameters.tools before passing params to the Strands model class (AnthropicModel, OpenAIModel) — Python @tool-decorated callables stay in code | Agent(tools=[...]) constructor; no per-call conversion |