{"id":21369,"library":"galaxy-tool-util-models","title":"Galaxy Tool Utility Models","description":"Pydantic models for Galaxy tools, providing type-safe data structures for tool definitions, parameters, inputs, outputs, and workflows. Current version 26.0.0, part of the Galaxy project, released as part of the main Galaxy monorepo with no fixed cadence.","status":"active","version":"26.0.0","language":"python","source_language":"en","source_url":"https://github.com/galaxyproject/galaxy","tags":["galaxy","pydantic","tool-definitions","workflow","bioinformatics"],"install":[{"cmd":"pip install galaxy-tool-util-models","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Core dependency for model definitions","package":"pydantic","optional":false}],"imports":[{"note":"The package name uses hyphens, but the import uses underscores in the module path.","wrong":"from galaxy_tool_util_models import Tool","symbol":"Tool","correct":"from galaxy.tool_util.models import Tool"},{"note":"All models are exported from the top-level models module.","wrong":"from galaxy.tool_util.models.parameters import ToolParameter","symbol":"ToolParameter","correct":"from galaxy.tool_util.models import ToolParameter"}],"quickstart":{"code":"from galaxy.tool_util.models import Tool, ToolParameter\n\n# Example: parse a tool definition (assuming raw dict)\nraw_tool = {\n    \"id\": \"example_tool\",\n    \"name\": \"Example Tool\",\n    \"inputs\": [\n        {\n            \"name\": \"input_file\",\n            \"type\": \"data\",\n            \"optional\": False\n        }\n    ]\n}\ntool = Tool(**raw_tool)\nprint(tool.name)\n","lang":"python","description":"Basic usage: import and instantiate Tool model from a dictionary. Models are Pydantic-based and validate data on creation."},"warnings":[{"fix":"Use 'from galaxy.tool_util.models import Tool'.","message":"Import path change: models moved from 'galaxy.tools' to 'galaxy.tool_util.models' in v21.x. Old imports like 'from galaxy.tools import Tool' will fail.","severity":"breaking","affected_versions":"<21.0"},{"fix":"Use 'WorkflowStep' model from the same module for workflow-related tool definitions.","message":"Removal of 'Tool.workflow' attribute. Workflow-specific fields are now in separate WorkflowStep models.","severity":"breaking","affected_versions":">=25.0"},{"fix":"Correct import: 'from galaxy.tool_util.models import ...'","message":"Package name vs import path: install with 'galaxy-tool-util-models' but import from 'galaxy.tool_util.models'. New users often try 'import galaxy_tool_util_models' which fails.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run: pip install galaxy-tool-util-models","cause":"Package 'galaxy-tool-util-models' is not installed.","error":"ModuleNotFoundError: No module named 'galaxy.tool_util'"},{"fix":"Check the model fields and types. Use model.schema() to see expected schema. Ensure fields like 'id' and 'name' are present.","cause":"Provided dictionary does not match the model schema (e.g., missing required field or wrong type).","error":"pydantic.error_wrappers.ValidationError: 1 validation error for Tool"},{"fix":"Access workflow-related data through the WorkflowStep model: from galaxy.tool_util.models import WorkflowStep","cause":"Attempting to access a removed attribute; workflow fields were separated in v25.0.","error":"AttributeError: 'Tool' object has no attribute 'workflow'"},{"fix":"Use: from galaxy.tool_util.models import Tool","cause":"Wrong import path: trying to import from the package namespace, not the 'models' submodule.","error":"ImportError: cannot import name 'Tool' from 'galaxy.tool_util'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}