Skip to content

feat(beta): support class methods and instance methods for tool helpers#1154

Open
Ashutosh0x wants to merge 1 commit intoanthropics:mainfrom
Ashutosh0x:feat/tool-method-support
Open

feat(beta): support class methods and instance methods for tool helpers#1154
Ashutosh0x wants to merge 1 commit intoanthropics:mainfrom
Ashutosh0x:feat/tool-method-support

Conversation

@Ashutosh0x
Copy link

Fixes #1087. Adds comprehensive support for class methods, instance methods, and static methods when using @beta_tool decorators.

Key changes:

  • Implemented the descriptor protocol (get) on tool classes to handle automatic binding.
  • Updated JSON schema generation to exclude 'self' and 'cls' parameters.
  • Updated decorators to correctly unwrap and re-wrap classmethod/staticmethod objects.
  • Changed tool objects to be directly callable (removing @Property on call) to fix method binding issues.

@Ashutosh0x Ashutosh0x requested a review from a team as a code owner January 26, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support class methods for tool helpers

1 participant