{"record":{"id":"e55df9b372fb17c3","repo":"crewAIInc/crewAI","slug":"project-name-name-would-generate-class-name","errorCode":null,"errorMessage":"Project name '{name}' would generate class name '{class_name}' which cannot start with a digit","messagePattern":"Project name '(.+?)' would generate class name '(.+?)' which cannot start with a digit","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"lib/cli/src/crewai_cli/create_crew.py","lineNumber":103,"sourceCode":"    reserved_names = get_reserved_script_names()\n    if folder_name in reserved_names:\n        raise ValueError(\n            f\"Project name '{name}' would generate folder name '{folder_name}' which is reserved. \"\n            f\"Reserved names are: {', '.join(sorted(reserved_names))}. \"\n            \"Please choose a different name.\"\n        )\n\n    class_name = name.replace(\"_\", \" \").replace(\"-\", \" \").title().replace(\" \", \"\")\n\n    class_name = re.sub(r\"[^a-zA-Z0-9_]\", \"\", class_name)\n\n    if not class_name:\n        raise ValueError(\n            f\"Project name '{name}' contains no valid characters for a Python class name\"\n        )\n\n    if class_name[0].isdigit():\n        raise ValueError(\n            f\"Project name '{name}' would generate class name '{class_name}' which cannot start with a digit\"\n        )\n\n    original_name_clean = re.sub(\n        r\"[^a-zA-Z0-9_]\", \"\", name.replace(\"_\", \"\").replace(\"-\", \"\").lower()\n    )\n    if (\n        keyword.iskeyword(original_name_clean)\n        or keyword.iskeyword(class_name)\n        or class_name in (\"True\", \"False\", \"None\")\n    ):\n        raise ValueError(\n            f\"Project name '{name}' would generate class name '{class_name}' which is a reserved Python keyword\"\n        )\n\n    if not class_name.isidentifier():\n        raise ValueError(\n            f\"Project name '{name}' would generate invalid Python class name '{class_name}'\"","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/cli/src/crewai_cli/create_crew.py#L85-L121","documentation":"Raised at the top of ContextualQueryTool._run when the agent_id argument is empty. agent_id is a required positional parameter identifying which Contextual AI agent to query; an empty string or None fails fast before any datastore-readiness polling or retrieval call is made.","triggerScenarios":"Calling the tool with agent_id='' or agent_id=None — typically an LLM emitting a blank parameter, or wiring a variable that was never populated.","commonSituations":"Agent-created flow where the agent ID from ContextualCreateAgentTool was not captured/passed through, template prompts that leave agent_id blank, or string formatting bugs producing empty values.","solutions":["Capture the agent id from agent = client.agents.create(...) / the create tool's output and pass it: tool._run(query='q', agent_id=agent_id).","If an LLM supplies arguments, describe agent_id as required in the tool schema/prompt so it is never blank.","Guard upstream: if not agent_id: raise/fetch it before calling."],"exampleFix":"# before\nresult = tool._run(query='what changed?', agent_id='')  # ValueError\n# after\nresult = tool._run(query='what changed?', agent_id=agent_id)  # e.g. from create output","handlingStrategy":"validation","validationCode":"if not agent_id or not agent_id.strip():\n    raise ValueError(\"agent_id is empty; create an agent first and pass its id\")\nresult = tool._run(query=query, agent_id=agent_id)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Persist the agent id returned by the create-agent step and thread it through explicitly.","State in the tool description/prompt that agent_id is required and where it comes from.","Never let an LLM-freely-generated argument reach the tool without an emptiness check."],"tags":["contextualai","validation","arguments","agent-id"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}