Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion skills.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"name": "aiconfig-tools",
"description": "Guide for giving your AI agents capabilities through tools. Helps you identify what your AI needs to do, create tool definitions, and attach them in a way that makes sense for your framework.",
"path": "skills/ai-configs/aiconfig-tools",
"version": "0.2.0",
"version": "0.3.0",
"compatibility": "Requires LaunchDarkly API token with ai-tool permissions."
},
{
Expand Down
10 changes: 3 additions & 7 deletions skills/ai-configs/aiconfig-create/references/api-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,9 @@ curl -X PATCH \
-H "Content-Type: application/json" \
-H "LD-API-Version: beta" \
-d '{
"model": {
"parameters": {
"tools": [
{"key": "search-database", "version": 1}
]
}
}
"tools": [
{"key": "search-database", "version": 1}
]
}'
```

Expand Down
10 changes: 5 additions & 5 deletions skills/ai-configs/aiconfig-tools/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Guide for giving your AI agents capabilities through tools. Helps y
compatibility: Requires LaunchDarkly API token with ai-tool permissions.
metadata:
author: launchdarkly
version: "0.2.0"
version: "0.3.0"
---

# AI Config Tools
Expand Down Expand Up @@ -45,7 +45,7 @@ What should the AI be able to do?
Follow [API Quick Start](references/api-quickstart.md):

1. **Create tool** — `POST /projects/{projectKey}/ai-tools` with key, description, schema
2. **Schema format** — Use OpenAI function calling format (type, function.name, function.parameters)
2. **Schema format** — Use JSON Schema format (type: object, properties, required)
3. **Clear descriptions** — The LLM uses the description to decide when to call

### Step 3: Attach to Variation
Expand All @@ -56,7 +56,7 @@ Tools cannot be attached during config creation. PATCH the variation:
PATCH /projects/{projectKey}/ai-configs/{configKey}/variations/{variationKey}
```

Body: `{"model": {"parameters": {"tools": [{"key": "tool-name", "version": 1}]}}}`
Body: `{"tools": [{"key": "tool-name", "version": 1}]}`

See [API Quick Start](references/api-quickstart.md) for full curl example.

Expand All @@ -71,7 +71,7 @@ See [API Quick Start](references/api-quickstart.md) for full curl example.
```bash
GET /projects/{projectKey}/ai-configs/{configKey}/variations/{variationKey}
```
Check `model.parameters.tools` includes your tool key.
Check the `tools` array includes your tool key.

3. **Report results:**
- ✓ Tool created with valid schema
Expand All @@ -88,7 +88,7 @@ LangGraph, CrewAI, AutoGen often generate schemas from function definitions. You
|-----------|--------|
| Tool already exists (409) | Use existing or create with different key |
| Wrong endpoint | Use `/ai-tools`, not `/ai-configs/tools` |
| Schema invalid | Use OpenAI function format |
| Schema invalid | Use JSON Schema format (type: object, properties, required) |

## What NOT to Do

Expand Down
59 changes: 27 additions & 32 deletions skills/ai-configs/aiconfig-tools/references/api-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Create and manage tools using the LaunchDarkly API.

**Endpoint:** `https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-tools`
**Endpoint:** `https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-tools`
Do NOT use `/ai-configs/tools` — that endpoint does not exist.

## Create a Tool
Expand All @@ -16,23 +16,24 @@ curl -X POST \
"key": "search-database",
"description": "Search the customer database",
"schema": {
"type": "function",
"function": {
"name": "search_database",
"description": "Search for records",
"parameters": {
"type": "object",
"properties": {
"query": {"type": "string", "description": "Search query"},
"limit": {"type": "integer", "default": 10}
},
"required": ["query"]
}
}
"type": "object",
"properties": {
"query": {"type": "string", "description": "Search query"},
"limit": {"type": "integer", "description": "Max results to return"}
},
"required": ["query"]
}
}'
```

### Optional Fields

| Field | Description |
|-------|-------------|
| `maintainerId` | User ID of the tool maintainer |
| `maintainerTeamKey` | Team key for tool ownership |
| `customParameters` | Additional custom parameters as JSON object |

## Attach to Variation

```bash
Expand All @@ -42,13 +43,9 @@ curl -X PATCH \
-H "Content-Type: application/json" \
-H "LD-API-Version: beta" \
-d '{
"model": {
"parameters": {
"tools": [
{"key": "search-database", "version": 1}
]
}
}
"tools": [
{"key": "search-database", "version": 1}
]
}'
```

Expand All @@ -70,19 +67,17 @@ curl -X GET \

## Schema Format

Use OpenAI function calling format:
Use JSON Schema format:

```json
{
"type": "function",
"function": {
"name": "function_name",
"description": "What the LLM uses to decide when to call",
"parameters": {
"type": "object",
"properties": { ... },
"required": [ ... ]
}
}
"type": "object",
"properties": {
"query": {"type": "string", "description": "Search query"},
"limit": {"type": "integer", "description": "Max results"}
},
"required": ["query"]
}
```

The tool `key` and `description` are set at the top level, not inside the schema.