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.

(await registry.lookupAction(`/tool/${name}`)) ||
(await registry.lookupAction(`/prompt/${name}`));
(await registry.lookupAction(`/prompt/${name}`)) ||
(await registry.lookupAction(`/dynamic-action-provider/${name}`));
Copy link
Collaborator

Choose a reason for hiding this comment

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

would we allow specifying tool names that are only resolvable through DAP without using the DAP ref syntax?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No. I don't think that's a good idea. You might have a /dynamic-action-provider/myDap1:tool/fs/read_file that is configured to read stuff from directory A and another one /dynamic-action-provider/myDap2:tool/fs/read_file that is configured to read stuff from directory B. If you just say /tool/fs/read_file it's ambiguous (and we don't know where to find it).

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.

3 participants