Skip to content

Commit 3200e9b

Browse files
committed
fix: Update tools API to use current format
- Change tool attachment from model.parameters.tools to tools array - Update schema format from OpenAI function wrapper to JSON Schema - Add optional fields documentation (maintainerId, maintainerTeamKey, customParameters) - Bump aiconfig-tools version to 0.3.0
1 parent fb5a94e commit 3200e9b

3 files changed

Lines changed: 35 additions & 44 deletions

File tree

skills/ai-configs/aiconfig-create/references/api-quickstart.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,9 @@ curl -X PATCH \
9393
-H "Content-Type: application/json" \
9494
-H "LD-API-Version: beta" \
9595
-d '{
96-
"model": {
97-
"parameters": {
98-
"tools": [
99-
{"key": "search-database", "version": 1}
100-
]
101-
}
102-
}
96+
"tools": [
97+
{"key": "search-database", "version": 1}
98+
]
10399
}'
104100
```
105101

skills/ai-configs/aiconfig-tools/SKILL.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Guide for giving your AI agents capabilities through tools. Helps y
44
compatibility: Requires LaunchDarkly API token with ai-tool permissions.
55
metadata:
66
author: launchdarkly
7-
version: "0.2.0"
7+
version: "0.3.0"
88
---
99

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

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

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

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

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

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

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

9393
## What NOT to Do
9494

skills/ai-configs/aiconfig-tools/references/api-quickstart.md

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Create and manage tools using the LaunchDarkly API.
44

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

88
## Create a Tool
@@ -16,23 +16,24 @@ curl -X POST \
1616
"key": "search-database",
1717
"description": "Search the customer database",
1818
"schema": {
19-
"type": "function",
20-
"function": {
21-
"name": "search_database",
22-
"description": "Search for records",
23-
"parameters": {
24-
"type": "object",
25-
"properties": {
26-
"query": {"type": "string", "description": "Search query"},
27-
"limit": {"type": "integer", "default": 10}
28-
},
29-
"required": ["query"]
30-
}
31-
}
19+
"type": "object",
20+
"properties": {
21+
"query": {"type": "string", "description": "Search query"},
22+
"limit": {"type": "integer", "description": "Max results to return"}
23+
},
24+
"required": ["query"]
3225
}
3326
}'
3427
```
3528

29+
### Optional Fields
30+
31+
| Field | Description |
32+
|-------|-------------|
33+
| `maintainerId` | User ID of the tool maintainer |
34+
| `maintainerTeamKey` | Team key for tool ownership |
35+
| `customParameters` | Additional custom parameters as JSON object |
36+
3637
## Attach to Variation
3738

3839
```bash
@@ -42,13 +43,9 @@ curl -X PATCH \
4243
-H "Content-Type: application/json" \
4344
-H "LD-API-Version: beta" \
4445
-d '{
45-
"model": {
46-
"parameters": {
47-
"tools": [
48-
{"key": "search-database", "version": 1}
49-
]
50-
}
51-
}
46+
"tools": [
47+
{"key": "search-database", "version": 1}
48+
]
5249
}'
5350
```
5451

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

7168
## Schema Format
7269

73-
Use OpenAI function calling format:
70+
Use JSON Schema format:
7471

7572
```json
7673
{
77-
"type": "function",
78-
"function": {
79-
"name": "function_name",
80-
"description": "What the LLM uses to decide when to call",
81-
"parameters": {
82-
"type": "object",
83-
"properties": { ... },
84-
"required": [ ... ]
85-
}
86-
}
74+
"type": "object",
75+
"properties": {
76+
"query": {"type": "string", "description": "Search query"},
77+
"limit": {"type": "integer", "description": "Max results"}
78+
},
79+
"required": ["query"]
8780
}
8881
```
82+
83+
The tool `key` and `description` are set at the top level, not inside the schema.

0 commit comments

Comments
 (0)