Skip to content

Callbacks cannot handle Closures/Callables #37

Open
@pascalheidmann

Description

@pascalheidmann

The withTool, withResource, withResourceTemplate, withPrompt, etc. all expect a callback as their first parameter but cannot handle native php callbacks (e.g. fn () => $foo()). This oversights makes adding dynamic callbacks very hard/impossible.

Is there anything that prevents from opening up for callables in general?

Edit: basically the same for registerTool, registerResource, registerResourceTemplate, registerPrompt, ..., which expect both a class & method name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions