feat: extract and publish tool metadata to AMP #4298
+627
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
crewai tool publishWhat's Included
Tool Metadata Extraction
Automatically extracts from BaseTool classes:
Publish Preview
Shows detected tools during publish with:
Non-blocking Errors
Metadata extraction failures show warnings but don't block publishing.
Payload Structure
{ "tools_metadata": { "tools": [ { "name": "ToolClassName", "humanized_name": "tool_name", "description": "Tool description", "run_params_schema": { }, "init_params_schema": { }, "env_vars": [ {"name": "API_KEY", "description": "...", "required": true, "default": null} ] } ] } }Note
Medium Risk
Adds dynamic module loading and Pydantic schema introspection during
crewai tool publish, and changes the publish payload sent to the Enterprise API. While failures are non-blocking, this touches the release flow and could surface edge cases in import/schema generation across tool projects.Overview
crewai tool publishnow attempts to extract rich metadata for exportedBaseToolclasses (module path, description/name defaults, JSON schemas for init and run params, and env var definitions) via a newextract_tools_metadatautility, and prints a pre-publish preview of the detected tools.The publish request to the Enterprise API now optionally includes this metadata under
tools_metadata(wrapped as{package, tools}), with warnings and continued publishing if metadata extraction fails; tests were updated/added to cover the new payload and extraction behavior.Written by Cursor Bugbot for commit 7c29545. This will update automatically on new commits. Configure here.