@elementor/angie-sdk 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -1
- package/dist/angie-annotations.d.ts +20 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,6 +20,7 @@ This SDK enables you to create custom MCP servers that Angie can discover and us
|
|
|
20
20
|
- [MCP Server Example](#mcp-server-example)
|
|
21
21
|
- [Adding Instructions to MCP Servers](#adding-instructions-to-mcp-servers)
|
|
22
22
|
- [Registering Tools](#registering-tools)
|
|
23
|
+
- [Tool Annotations](#tool-annotations)
|
|
23
24
|
- [Handling Tool Calls](#handling-tool-calls)
|
|
24
25
|
- [Best Practices](#best-practices)
|
|
25
26
|
- [Remote SSE and HTTP Streamable MCP servers](#remote-sse-and-http-streamable-mcp-servers)
|
|
@@ -105,7 +106,7 @@ The SDK covers three main abilities:
|
|
|
105
106
|
|
|
106
107
|
📖 **Documentation:**
|
|
107
108
|
- [MCP SDK Supported Features](./docs/angie-sdk-supported-features.md)
|
|
108
|
-
- [Tool
|
|
109
|
+
- [Tool Annotations](./docs/tool-annotations.md) - Annotate tools with resource dependencies, model preferences, and more
|
|
109
110
|
|
|
110
111
|
---
|
|
111
112
|
|
|
@@ -317,6 +318,41 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
317
318
|
|
|
318
319
|
---
|
|
319
320
|
|
|
321
|
+
## Tool Annotations
|
|
322
|
+
|
|
323
|
+
Angie extends MCP tool annotations with Angie-specific metadata. Import the annotation constants directly from `@elementor/angie-sdk`:
|
|
324
|
+
|
|
325
|
+
```typescript
|
|
326
|
+
import {
|
|
327
|
+
ANGIE_REQUIRED_RESOURCES,
|
|
328
|
+
ANGIE_MODEL_PREFERENCES,
|
|
329
|
+
ANGIE_EXTENDED_TIMEOUT,
|
|
330
|
+
MCP_READONLY,
|
|
331
|
+
ToolAnnotations,
|
|
332
|
+
} from '@elementor/angie-sdk';
|
|
333
|
+
|
|
334
|
+
server.tool(
|
|
335
|
+
'analyze-page-layout',
|
|
336
|
+
'Analyzes the current page layout and returns suggestions',
|
|
337
|
+
{ /* input schema */ },
|
|
338
|
+
{
|
|
339
|
+
[MCP_READONLY]: true,
|
|
340
|
+
[ANGIE_EXTENDED_TIMEOUT]: { timeoutMs: 30000 },
|
|
341
|
+
[ANGIE_REQUIRED_RESOURCES]: [
|
|
342
|
+
{ uri: 'elementor://page/layout', whenToUse: 'Always — needed to read the page structure' }
|
|
343
|
+
],
|
|
344
|
+
[ANGIE_MODEL_PREFERENCES]: {
|
|
345
|
+
hints: [{ name: 'claude-sonnet' }]
|
|
346
|
+
}
|
|
347
|
+
} as ToolAnnotations,
|
|
348
|
+
async (args) => { /* handler */ }
|
|
349
|
+
);
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
📖 See [Tool Annotations](./docs/tool-annotations.md) for full reference.
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
320
356
|
## Handling Tool Calls
|
|
321
357
|
|
|
322
358
|
Implement a handler for `CallToolRequestSchema`:
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const ANGIE_REQUIRED_RESOURCES: "angie/requiredResources";
|
|
2
|
+
export declare const ANGIE_MODEL_PREFERENCES: "angie/modelPreferences";
|
|
3
|
+
export declare const ANGIE_EXTENDED_TIMEOUT: "angie/extendedTimeout";
|
|
4
|
+
export declare const MCP_READONLY: "readOnlyHint";
|
|
5
|
+
export interface AngieRequiredResource {
|
|
6
|
+
uri: string;
|
|
7
|
+
whenToUse: string;
|
|
8
|
+
params?: Record<string, string>;
|
|
9
|
+
}
|
|
10
|
+
export interface AngieModelPreferences {
|
|
11
|
+
hints?: Array<{
|
|
12
|
+
name: string;
|
|
13
|
+
}>;
|
|
14
|
+
costPriority?: number;
|
|
15
|
+
speedPriority?: number;
|
|
16
|
+
intelligencePriority?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface AngieExtendedTimeout {
|
|
19
|
+
timeoutMs: number;
|
|
20
|
+
}
|