Skip to content

Conversation

@thiagomoretto
Copy link
Contributor

@thiagomoretto thiagomoretto commented Jan 28, 2026

Summary

  • Extracts rich metadata from tool classes during crewai tool publish
  • Sends metadata to AMP backend for enhanced tool discoverability
  • Displays preview of detected tools before publishing

What's Included

Tool Metadata Extraction

Automatically extracts from BaseTool classes:

  • Tool name and description
  • Init parameters schema (custom Pydantic fields)
  • Run parameters schema (from args_schema)
  • Environment variables (name, description, required, default)

Publish Preview

Shows detected tools during publish with:

  • Tool name and description
  • Init parameters with types and defaults
  • Required environment variables

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 publish now attempts to extract rich metadata for exported BaseTool classes (module path, description/name defaults, JSON schemas for init and run params, and env var definitions) via a new extract_tools_metadata utility, 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.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

}
return json_schema
except Exception:
return {}
Copy link

Choose a reason for hiding this comment

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

JSON schema required list not filtered with properties

Medium Severity

The _extract_init_params_schema function filters out base fields from properties (like name, description) but doesn't correspondingly filter the required list in the JSON schema. Since BaseTool defines name and description without defaults, they appear in the required list. The resulting schema will have required referencing properties that don't exist, creating an invalid JSON schema that could cause issues when the AMP backend processes it.

Fix in Cursor Fix in Web

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.

2 participants