Skip to content

Models

ActionResultModel

Standardized result for all action executions. Backed by a Rust struct via PyO3.

Fields

FieldTypeDefaultDescription
successboolTrueWhether the execution was successful
messagestr""Human-readable result description
promptOptional[str]NoneSuggestion for AI about next steps
errorOptional[str]NoneError message when success is False
contextDict[str, Any]{}Additional context data

Methods

MethodReturnsDescription
with_error(error)ActionResultModelCreate copy with error info (sets success=False)
with_context(**kwargs)ActionResultModelCreate copy with updated context
to_dict()Dict[str, Any]Convert to dictionary

Factory Functions

python
from dcc_mcp_core import success_result, error_result, from_exception, validate_action_result

# Success result with context
result = success_result("Created 5 spheres", prompt="Use modify_spheres next", count=5)

# Error result with possible solutions
error = error_result(
    "Failed", "File not found",
    prompt="Check path",
    possible_solutions=["Verify file exists", "Check permissions"],
    path="/bad/path",
)

# From exception string
exc_result = from_exception(
    "ValueError: bad input",
    message="Import failed",
    include_traceback=True,
)

# Validate/normalize any value to ActionResultModel
validate_action_result(result)                          # pass-through
validate_action_result({"success": True, "message": "OK"})  # dict → ARM
validate_action_result("hello")                         # wrap as success

SkillMetadata

Metadata parsed from SKILL.md frontmatter. All fields are readable and writable.

Fields

FieldTypeDefaultDescription
namestrUnique identifier
descriptionstr""Human-readable description
toolsList[str][]Required tool permissions
dccstr"python"Target DCC application
tagsList[str][]Classification tags
scriptsList[str][]Discovered script file paths
skill_pathstr""Absolute path to skill directory
versionstr"1.0.0"Skill version
dependsList[str][]Names of required skills
metadata_filesList[str][]Files in metadata/ directory

Released under the MIT License.