ComposioHQ/composio · error · ValueError

Missing 'title' in param_schema: {param_schema}

Error message

Missing 'title' in param_schema: {param_schema}

What it means

pydantic_model_from_param_schema requires param_schema to contain a "title" key, which becomes the generated Pydantic model's name. A missing title means the converter cannot construct a model class and raises ValueError echoing the schema.

Source

Thrown at python/composio/utils/shared.py:613

    )


def pydantic_model_from_param_schema(param_schema: t.Dict) -> t.Type:
    """
    Dynamically creates a Pydantic model from a schema dictionary.

    :param param_schema: Schema with 'title', 'properties', and optionally 'required' keys.
    :return: A Pydantic model class for the defined schema.

    :raised ValueError: Invalid 'type' for property or recursive model creation.

    Note: Requires global `schema_type_python_type_dict` for type mapping and
        `fallback_values` for default values.
    """
    required_fields = {}
    optional_fields = {}
    if "title" not in param_schema:
        raise ValueError(f"Missing 'title' in param_schema: {param_schema}")

    param_title = str(param_schema["title"]).replace(" ", "")
    required_props = param_schema.get("required", [])

    if param_schema.get("type") == "array":
        # print("param_schema inside array - ", param_schema)
        item_schema = param_schema.get("items")
        if item_schema:
            ItemType = t.cast(
                t.Type,
                json_schema_to_pydantic_type(
                    json_schema=item_schema,
                ),
            )
            return t.List[ItemType]  # type: ignore
        return t.List

    for prop_name, prop_info in param_schema.get("properties", {}).items():

View on GitHub (pinned to 64b1b85502)

Solutions

  1. Add "title" to the param schema: a PascalCase name like "SearchInput" (spaces are stripped in the model name)
  2. If building custom tools, use the SDK's standard tool-definition helpers which populate title automatically
  3. Check for accidental overwriting of param_schema dicts before passing them in

Example fix

# before
model = pydantic_model_from_param_schema({"type": "object", "properties": {}})
# after
model = pydantic_model_from_param_schema({"title": "SearchInput", "type": "object", "properties": {}})
Defensive patterns

Strategy: validation

Validate before calling

def has_title(param_schema):
    return isinstance(param_schema, dict) and "title" in param_schema

Type guard

def is_valid_param_schema(p) -> bool:
    return isinstance(p, dict) and isinstance(p.get("title"), str) and p["title"].strip() != ""

Try / catch

try:
    model = pydantic_model_from_param_schema(p)
except ValueError as e:
    if "Missing 'title'" in str(e):
        p = {**p, "title": derived_name}
        model = pydantic_model_from_param_schema(p)

Prevention

When it happens

Trigger: Calling pydantic_model_from_param_schema (or get_signature_format_from_schema_params) with a param schema dict lacking "title" — common with hand-built schemas or stripped-down specs where only type/properties were provided.

Common situations: Custom tools defined with minimal schemas (omitting the title the generator expects); transformations that drop title fields; backend schema versions that stopped including titles after a client update.

Related errors


AI-assisted analysis of ComposioHQ/composio@64b1b85502 (2026-08-28). Data as JSON: /api/errors/b15c160d70a9c907. Report an issue: GitHub.