iflytek/astron-agent · error · Exception

no attr found in tool info!

Error message

no {field} attr found in tool info!

What it means

Generic Exception raised in process_tools_for_update when an incoming tool payload is missing one of the required fields: version, name, description, or openapi_schema. It is input validation guarding the tool update (version bump) flow.

Solutions

  1. Include all required fields (version, name, description, openapi_schema) in every tool entry sent to the update endpoint.
  2. Log which tool/index failed (the message names the field but not the tool) to pinpoint the offending entry.
  3. Use Pydantic/dataclass models with required fields so FastAPI returns a precise 422 automatically.
  4. Improve the message to include tool name/id: f"tool missing {field}: {tool.get('name')}".

Example fix

// before
raise Exception(f"no {field} attr found in tool info!")
// after
class ToolUpdateSchema(BaseModel):
    version: str
    name: str
    description: str
    openapi_schema: str
# FastAPI rejects incomplete payloads with a 422 naming the missing fields
Defensive patterns

Strategy: validation

Validate before calling

REQUIRED = {"version", "name", "description", "openapi_schema"}
def tool_payload_ok(tool: dict) -> bool:
    return REQUIRED.issubset(tool) and all(tool[f] for f in REQUIRED)

Try / catch

try:
    process_tools_for_update(tools, span_context)
except Exception as e:
    return error_response(400, str(e))

Prevention

When it happens

Trigger: update_version -> process_tools_for_update iterates the tools array and a tool dict lacks any required field — e.g. client submits a partial PATCH-like body with only 'name' or omits 'openapi_schema'.

Common situations: API consumers send partial updates instead of full tool objects; frontend form not sending all fields; bulk import files missing columns; field renamed client/server after a version change.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/554799f3bacfb388. Report an issue: GitHub.

Appendix: source

Thrown at core/plugin/link/service/community/tools/http/management_server.py:289

    for tool_id in tool_ids:
        if not re.compile("^tool@[0-9a-zA-Z]+$").match(tool_id):
            return f"tool id {tool_id} illegal"
    return None


def process_tools_for_update(
    tools: List[Dict[str, Any]], app_id: Optional[str], span_context: Any
) -> Tuple[Optional[List[Dict[str, Any]]], List[str]]:
    """Process tools for update, including validation."""
    update_tool = []
    tool_ids = []

    for tool in tools:
        # Validate required fields
        required_fields = ["version", "name", "description", "openapi_schema"]
        for field in required_fields:
            if field not in tool:
                raise Exception(f"no {field} attr found in tool info!")

        schema_content = tool.get("openapi_schema", "")
        if schema_content:
            validated_schema, err = validate_openapi_schema(tool, span_context)
            if err:
                raise Exception(
                    f"update tool: failed to validate tool {tool.get('id')} schema, "
                    f"reason {json.dumps(err)}"
                )
            schema_content = validated_schema

        update_tool.append(
            {
                "app_id": app_id,
                "tool_id": tool.get("id"),
                "name": tool.get("name"),
                "description": tool.get("description"),
                "open_api_schema": schema_content,

View on GitHub (pinned to 5e758547a8)