Skip to content

[AI-6713] Migrate to registerTool() API and add _meta types#26

Merged
netanelavr merged 4 commits intomasterfrom
AI-6713-migrate-to-registerTool-and-meta
Mar 9, 2026
Merged

[AI-6713] Migrate to registerTool() API and add _meta types#26
netanelavr merged 4 commits intomasterfrom
AI-6713-migrate-to-registerTool-and-meta

Conversation

@netanelavr
Copy link
Copy Markdown
Member

@netanelavr netanelavr commented Mar 9, 2026

What Changed

1. New Type Interfaces (angie-annotations.ts)

  • AngieToolMeta - Interface for custom Angie metadata that should be placed in the _meta field:

    • angie/requiredResources
    • angie/modelPreferences
    • angie/extendedTimeout
  • AngieToolAnnotations - Interface for standard MCP annotations that stay in annotations:

    • title
    • destructiveHint
    • readOnlyHint

2. Demo Server Migration (demo-mcp-server.ts)

Migrated all 4 tools from deprecated server.tool() to new server.registerTool() API:

Before:

server.tool(name, description, inputSchema, handler)

After:

server.registerTool(name, { description, inputSchema, annotations }, handler)

3. Tests

Added type validation tests for the new interfaces.

Backward Compatibility

This is a non-breaking change. Existing 3rd party integrations will continue to work:

  • The deprecated .tool() API still functions (just not recommended)
  • The elementor-ai frontend merges annotations from both old and new locations
  • Backend continues to receive annotations in the expected format

Type of Change

  • Refactor (non-breaking change — structural only)
  • Documentation/Types update

Made with Cursor

✨ PR Description

Purpose: Migrate MCP server tool registration from deprecated tool() method to registerTool() API and separate standard annotations from custom Angie metadata using _meta field.

Main changes:

  • Replaced server.tool() calls with server.registerTool() API, restructuring tool definitions to use inputSchema and annotations fields
  • Added AngieToolMeta and AngieToolAnnotations TypeScript interfaces to distinguish custom vendor metadata from standard MCP protocol annotations
  • Updated documentation and code examples to clarify annotations belong in annotations field while Angie-specific metadata uses _meta field

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how

Align SDK with elementor-ai changes from PR #2666 and #2667:

- Add AngieToolMeta interface for custom Angie metadata (_meta field)
- Add AngieToolAnnotations interface for standard MCP annotations
- Migrate demo server from deprecated .tool() to registerTool() API
- Add tests for new type interfaces

This is a non-breaking change - existing integrations continue to work.

Made-with: Cursor
OrTab
OrTab previously approved these changes Mar 9, 2026
Copy link
Copy Markdown
Member

@matipojo matipojo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- Restore comments in fireworks demo code
- Update tool-annotations.md documentation:
  - Explain annotations vs _meta separation
  - Update all examples to use registerTool() API
  - Add migration guide from server.tool() to registerTool()

Made-with: Cursor
OrTab
OrTab previously approved these changes Mar 9, 2026
@netanelavr netanelavr merged commit 978557b into master Mar 9, 2026
14 checks passed
@netanelavr netanelavr deleted the AI-6713-migrate-to-registerTool-and-meta branch March 9, 2026 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants