{"record":{"id":"97d152f458f7cdbe","repo":"ComposioHQ/composio","slug":"could-not-determine-a-home-directory-to-store-the","errorCode":null,"errorMessage":"Could not determine a home directory to store the Composio cache in. Provide a writable path using the {ENV_LOCAL_CACHE_DIRECTORY} environment variable.","messagePattern":"Could not determine a home directory to store the Composio cache in\\. Provide a writable path using the (.+?) environment variable\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"python/composio/core/models/_files.py","lineNumber":113,"sourceCode":"\ndef get_cache_directory() -> Path:\n    \"\"\"Resolve the local caching directory without touching the filesystem.\n\n    ``COMPOSIO_CACHE_DIR`` is read on every call, so it can be set after\n    ``composio`` has already been imported. ``Path.home()`` is only consulted\n    when the variable is unset: it can raise ``RuntimeError`` when there is no\n    resolvable home directory, which is exactly the situation\n    ``COMPOSIO_CACHE_DIR`` exists to work around, so it must not be evaluated\n    eagerly as a fallback argument.\n    \"\"\"\n    configured = os.environ.get(ENV_LOCAL_CACHE_DIRECTORY)\n    if configured:\n        return Path(configured)\n\n    try:\n        home = Path.home()\n    except RuntimeError as e:\n        raise RuntimeError(\n            \"Could not determine a home directory to store the Composio cache \"\n            f\"in. Provide a writable path using the {ENV_LOCAL_CACHE_DIRECTORY} \"\n            \"environment variable.\"\n        ) from e\n    return home / LOCAL_CACHE_DIRECTORY_NAME\n\n\ndef get_output_file_directory() -> Path:\n    \"\"\"Default local directory into which files downloaded during tool\n    execution are written. Override by passing ``file_download_dir=...`` to\n    Composio, or by setting ``outdir`` on ``FileHelper`` directly.\n    \"\"\"\n    return get_cache_directory() / LOCAL_OUTPUT_FILE_DIRECTORY_NAME\n\n\ndef ensure_cache_directory() -> Path:\n    \"\"\"Create the cache directory on first use and check that it is writable.\n","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/python/composio/core/models/_files.py#L95-L131","documentation":"A custom toolkit was constructed without a description. The experimental.Toolkit constructor requires both a name and a non-empty description so custom toolkits can be surfaced and documented server-side; an empty or missing description fails fast with a ValidationError.","triggerScenarios":"Creating experimental.Toolkit(slug=..., name=..., description='') or passing description=None when defining a custom toolkit in the Python SDK.","commonSituations":"Copying a toolkit template and forgetting the description field; assuming description is optional like other kwargs; passing an empty string after stripping user input.","solutions":["Add a meaningful description string to the Toolkit constructor","Check that the variable feeding description isn't None/empty before constructing the toolkit"],"exampleFix":"# before\ntk = Toolkit(slug='my_tk', name='My Toolkit', description='')\n# after\ntk = Toolkit(slug='my_tk', name='My Toolkit', description='Tools for managing my app resources')","handlingStrategy":"validation","validationCode":"if not description or not description.strip():\n    raise ValueError('Toolkit description is required')\ntk = Toolkit(slug=slug, name=name, description=description.strip())","typeGuard":"from composio.core.models.custom_tool import Toolkit\n\ndef is_valid_toolkit_def(slug: str, name: str, description: str) -> bool:\n    return bool(slug) and bool(name) and bool(description and description.strip())","tryCatchPattern":"try:\n    tk = Toolkit(slug=s, name=n, description=d)\nexcept ValidationError as e:\n    if 'description is required' in str(e):\n        d = 'Custom toolkit for ' + n\n        tk = Toolkit(slug=s, name=n, description=d)\n    else:\n        raise","preventionTips":["Always fill in a human-readable description when defining toolkits","Validate required fields before constructing SDK model objects"],"tags":["python","custom-tools","validation","toolkit"],"backgroundTag":"missing-required-field","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}