Skip to content

Conversation

ifielker
Copy link
Collaborator

@ifielker ifielker commented Sep 17, 2025

Checklist (if applicable):

Comment on lines +104 to +107
ai.defineDynamicActionProvider(options.name, async () => ({
tool: await mcpHost.getActiveTools(ai),
resource: await mcpHost.getActiveResources(ai),
}));
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a strong opinion but looks like the delta between the old and new APIs is only these 4 lines.

Do we need to deprecate the old API instead of providing dynamic actions as an add on?

createMcpHost({...}).withDynamicActions({ai})

This is not consistent with our defineBlah({ai, ...}) APIs but it will avoid deprecating the old one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It requires the ai parameter and it also makes the name field of the options a required field. It's a breaking change to createMcpHost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants