Skip to content

Commit f3cd566

Browse files
committed
feat(appkit): update tool/mcp API
Signed-off-by: Hubert Zub <hubert.zub@databricks.com>
1 parent a9568df commit f3cd566

34 files changed

+1126
-175
lines changed

apps/dev-playground/server/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ createApp({
4343
],
4444
...(process.env.APPKIT_E2E_TEST && { client: createMockClient() }),
4545
}).then(async (appkit) => {
46-
// Add tools (and optionally MCP servers) after app creation
47-
await appkit.agent.addCapabilities({ tools: [demoTools.timeTool] });
46+
// Add tools after app creation
47+
await appkit.agent.addTools([demoTools.timeTool]);
4848

4949
appkit.server
5050
.extend((app) => {
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Class: StandardAgent
2+
3+
Contract that agent implementations must fulfil.
4+
5+
The plugin calls `invoke()` for non-streaming requests and `stream()` for
6+
SSE streaming. Implementations are responsible for translating their SDK's
7+
output into Responses API types.
8+
9+
## Implements
10+
11+
- [`AgentInterface`](Interface.AgentInterface.md)
12+
13+
## Constructors
14+
15+
### Constructor
16+
17+
```ts
18+
new StandardAgent(agent: LangGraphAgent, systemPrompt: string): StandardAgent;
19+
```
20+
21+
#### Parameters
22+
23+
| Parameter | Type |
24+
| ------ | ------ |
25+
| `agent` | `LangGraphAgent` |
26+
| `systemPrompt` | `string` |
27+
28+
#### Returns
29+
30+
`StandardAgent`
31+
32+
## Methods
33+
34+
### invoke()
35+
36+
```ts
37+
invoke(params: InvokeParams): Promise<ResponseOutputItem[]>;
38+
```
39+
40+
#### Parameters
41+
42+
| Parameter | Type |
43+
| ------ | ------ |
44+
| `params` | [`InvokeParams`](Interface.InvokeParams.md) |
45+
46+
#### Returns
47+
48+
`Promise`\<[`ResponseOutputItem`](TypeAlias.ResponseOutputItem.md)[]\>
49+
50+
#### Implementation of
51+
52+
[`AgentInterface`](Interface.AgentInterface.md).[`invoke`](Interface.AgentInterface.md#invoke)
53+
54+
***
55+
56+
### stream()
57+
58+
```ts
59+
stream(params: InvokeParams): AsyncGenerator<ResponseStreamEvent>;
60+
```
61+
62+
#### Parameters
63+
64+
| Parameter | Type |
65+
| ------ | ------ |
66+
| `params` | [`InvokeParams`](Interface.InvokeParams.md) |
67+
68+
#### Returns
69+
70+
`AsyncGenerator`\<[`ResponseStreamEvent`](TypeAlias.ResponseStreamEvent.md)\>
71+
72+
#### Implementation of
73+
74+
[`AgentInterface`](Interface.AgentInterface.md).[`stream`](Interface.AgentInterface.md#stream)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Function: createInvokeHandler()
2+
3+
```ts
4+
function createInvokeHandler(getAgent: () => AgentInterface): RequestHandler;
5+
```
6+
7+
Create an Express handler that invokes the agent via the AgentInterface
8+
and streams/returns the response in Responses API format.
9+
10+
## Parameters
11+
12+
| Parameter | Type |
13+
| ------ | ------ |
14+
| `getAgent` | () => [`AgentInterface`](Interface.AgentInterface.md) |
15+
16+
## Returns
17+
18+
`RequestHandler`
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Function: isFunctionTool()
2+
3+
```ts
4+
function isFunctionTool(t: unknown): t is FunctionTool;
5+
```
6+
7+
## Parameters
8+
9+
| Parameter | Type |
10+
| ------ | ------ |
11+
| `t` | `unknown` |
12+
13+
## Returns
14+
15+
`t is FunctionTool`
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Function: isHostedTool()
2+
3+
```ts
4+
function isHostedTool(t: unknown): t is HostedTool;
5+
```
6+
7+
## Parameters
8+
9+
| Parameter | Type |
10+
| ------ | ------ |
11+
| `t` | `unknown` |
12+
13+
## Returns
14+
15+
`t is HostedTool`

docs/docs/api/appkit/Interface.AgentInterface.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ invoke(params: InvokeParams): Promise<ResponseOutputItem[]>;
2222

2323
#### Returns
2424

25-
`Promise`\<`ResponseOutputItem`[]\>
25+
`Promise`\<[`ResponseOutputItem`](TypeAlias.ResponseOutputItem.md)[]\>
2626

2727
***
2828

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Interface: CustomMcpServerTool
2+
3+
## Properties
4+
5+
### custom\_mcp\_server
6+
7+
```ts
8+
custom_mcp_server: {
9+
app_name: string;
10+
app_url: string;
11+
};
12+
```
13+
14+
#### app\_name
15+
16+
```ts
17+
app_name: string;
18+
```
19+
20+
#### app\_url
21+
22+
```ts
23+
app_url: string;
24+
```
25+
26+
***
27+
28+
### type
29+
30+
```ts
31+
type: "custom_mcp_server";
32+
```
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Interface: ExternalMcpServerTool
2+
3+
## Properties
4+
5+
### external\_mcp\_server
6+
7+
```ts
8+
external_mcp_server: {
9+
connection_name: string;
10+
};
11+
```
12+
13+
#### connection\_name
14+
15+
```ts
16+
connection_name: string;
17+
```
18+
19+
***
20+
21+
### type
22+
23+
```ts
24+
type: "external_mcp_server";
25+
```
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Interface: GenieTool
2+
3+
OpenResponses-style hosted tool definitions for Databricks services.
4+
5+
These types follow the OpenResponses convention of discriminating on `type`.
6+
Internally, each hosted tool is resolved to a DatabricksMCPServer instance
7+
so the agent can call managed MCP endpoints on the workspace.
8+
9+
## Properties
10+
11+
### genie\_space
12+
13+
```ts
14+
genie_space: {
15+
id: string;
16+
};
17+
```
18+
19+
#### id
20+
21+
```ts
22+
id: string;
23+
```
24+
25+
***
26+
27+
### type
28+
29+
```ts
30+
type: "genie";
31+
```

docs/docs/api/appkit/Interface.IAgentConfig.md

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,6 @@ Max tokens to generate (default 2000). Ignored when `agentInstance` is provided.
4949

5050
***
5151

52-
### mcpServers?
53-
54-
```ts
55-
optional mcpServers: DatabricksMCPServer[];
56-
```
57-
58-
MCP servers for Databricks tool integration. Ignored when `agentInstance` is provided.
59-
60-
***
61-
6252
### model?
6353

6454
```ts
@@ -121,8 +111,10 @@ Sampling temperature (0.0-1.0, default 0.1). Ignored when `agentInstance` is pro
121111
optional tools: AgentTool[];
122112
```
123113

124-
Tools to register with the agent. Accepts OpenResponses-aligned FunctionTool
125-
objects or LangChain StructuredToolInterface instances.
114+
Tools to register with the agent. Accepts:
115+
- OpenResponses-aligned `FunctionTool` objects (local tool with execute handler)
116+
- Databricks hosted tools (`genie`, `vector_search_index`, `custom_mcp_server`, `external_mcp_server`)
117+
126118
Ignored when `agentInstance` is provided.
127119

128120
***

0 commit comments

Comments
 (0)