{"record":{"id":"835f7714f0be680e","repo":"crewAIInc/crewAI","slug":"tool-crewai-definition-must-be-a-string-project","errorCode":null,"errorMessage":"[tool.crewai] definition must be a string project-local path; got {raw_definition!r}.","messagePattern":"\\[tool\\.crewai\\] definition must be a string project-local path; got (.+?)\\.","errorType":"exception","errorClass":"ProjectDefinitionError","httpStatus":null,"severity":"error","filePath":"lib/crewai-core/src/crewai_core/project.py","lineNumber":84,"sourceCode":"    \"\"\"Return a configured CrewAI definition path for a project type.\n\n    ``[tool.crewai].type`` must match ``project_type`` and ``definition`` must\n    be a non-empty project-local file path. Missing definitions return ``None``\n    so callers can fall back to legacy entrypoints for that project type.\n    \"\"\"\n    root = Path(project_root) if project_root is not None else Path.cwd()\n    if pyproject_data is None:\n        pyproject_data = read_toml(root / \"pyproject.toml\")\n\n    crewai_config = get_crewai_project_config(pyproject_data)\n    if crewai_config.get(\"type\") != project_type:\n        return None\n\n    if \"definition\" not in crewai_config:\n        return None\n    raw_definition = crewai_config[\"definition\"]\n    if not isinstance(raw_definition, str):\n        raise ProjectDefinitionError(\n            \"[tool.crewai] definition must be a string project-local path; \"\n            f\"got {raw_definition!r}.\"\n        )\n\n    definition = raw_definition.strip()\n    if not definition:\n        raise ProjectDefinitionError(\n            \"[tool.crewai] definition must be a non-empty project-local path.\"\n        )\n\n    return resolve_project_definition_path(definition=definition, project_root=root)\n\n\ndef resolve_project_definition_path(definition: str, project_root: Path | str) -> Path:\n    \"\"\"Resolve a ``[tool.crewai].definition`` path inside ``project_root``.\"\"\"\n    root_path = Path(project_root)\n    definition_path = Path(definition)\n    windows_definition_path = PureWindowsPath(definition)","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-core/src/crewai_core/project.py#L66-L102","documentation":"Error \"[tool.crewai] definition must be a string project-local path; got {raw_definition!r}.\" thrown in crewAIInc/crewAI.","triggerScenarios":"Thrown at lib/crewai-core/src/crewai_core/project.py:84 when the library encounters an invalid state.","commonSituations":"Occurs when [tool.crewai] definition in pyproject.toml is not a string. Set it to a string path relative to the project root.","solutions":["Set [tool.crewai].definition in pyproject.toml to a string path relative to the project root, e.g. definition = \"crew.json\".","Remove non-string values from the definition setting."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}