Skip to main content
Glama

execute

Destructive

Execute custom code using Python, HScript, or expressions within Houdini. Verify API functionality or perform complex operations with full process rights.

Instructions

Run code in Houdini, with the full hou module and no guard.

Modes: python, hscript, expression, vex_check, env, job.

Use it for what no other tool covers, and to confirm an API in the live
session, for example `print(dir(hou.Node))`. The code runs with the rights
of the Houdini process: it can write files, delete nodes and quit Houdini.

Do not use it to build a network: one batch of node_edit create, connect
and parm_set is also one round trip, and each step reports its errors.
`hou.Node.inputs()` skips network dots and gives the node behind them; use
`inputConnections()` and `inputItem()` for the real wiring before you
rewire or delete.

Prefer a named tool when one exists. A write in code to a parameter that
holds an expression, that is disabled or hidden, or whose range clamps the
value changes nothing, and a write to a channel reference changes another
node. The answer lists each such write in `write_warnings`; read it. If you
write the same script twice, the named tool for it is missing: say so in
the feedback at the end of the session.

mode:
    "python"     — run `source` as Python. Returns stdout and stderr, and
                   keeps them when the script raises. Print what you want
                   to see: the value of the last line does not come back.
    "hscript"    — run `source` as an HScript command.
    "expression" — evaluate `source` as an expression. `language` is
                   "hscript" or "python".
    "vex_check"  — compile `source` as VEX and report the errors. Nothing
                   runs.
    "env"        — read the Houdini variable `name`, for example "HIP".
    "job"        — the state of the background job `job`: running, with
                   what it printed so far, or done, with its result.
                   `wait` waits for the end, up to that many seconds.

Use `file` for a script that you run again with other values. Houdini
answers nothing while a script runs: for long work, such as a sweep, use
`background` with a large `timeout`. session action='interrupt' stops it.

Input Schema

NameRequiredDescriptionDefault
jobNojob: the job id that background returned.
argsNofile: the values of sys.argv[1:].
fileNoA Python file to run instead of source, as from a shell: __file__ is its path, __name__ is "__main__", args are in sys.argv[1:]. The text travels once.
modeNoOne of "python", "hscript", "expression", "vex_check", "env", "job".python
nameNoenv: the Houdini variable to read, for example "HIP".
waitNojob: the most seconds to wait for the job to end. The answer comes when it ends or when the wait is over, with what it printed so far.
sourceNoThe code: Python, HScript, an expression or VEX, as mode says.
globalsNoNames that exist before the script runs, for example {"radius": 2.0}.
timeoutNoThe seconds the script may run. Past it, the script stops where it is, the answer says where, and what it changed stays.
languageNoexpression: "hscript" or "python".hscript
backgroundNopython: return at once with a job id and let the script run. Read it with mode job. Until it ends, other calls are refused.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.8.0
    • addedInput schema / properties / wait
      Added value: +{
      +  "default": 0,
      +  "description": "job: the most seconds to wait for the job to end. The answer comes when it ends or when the wait is over, with what it printed so far.",
      +  "type": "number"
      +}
  2. Changed1 schema field changedv0.7.5
    • changedInput schema / properties / background / description
      Previous value: -"python: return at once with a job id and let the script run. Read it with mode job. Other calls wait until it ends."New value: +"python: return at once with a job id and let the script run. Read it with mode job. Until it ends, other calls are refused."
  3. Changed49 schema fields changedv0.7.3
    • removedInput schema / properties / args / anyOf
      Removed value: -[
      -  {
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / args / default
      Removed value: -null
    • addedInput schema / properties / args / description
      Added value: +"file: the values of sys.argv[1:]."
    • addedInput schema / properties / args / items
      Added value: +{
      +  "type": "string"
      +}
    • removedInput schema / properties / args / title
      Removed value: -"Args"
    • addedInput schema / properties / args / type
      Added value: +"array"
    • removedInput schema / properties / background / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / background / description
      Added value: +"python: return at once with a job id and let the script run. Read it with mode job. Other calls wait until it ends."
    • removedInput schema / properties / background / title
      Removed value: -"Background"
    • addedInput schema / properties / background / type
      Added value: +"boolean"
    • removedInput schema / properties / file / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / file / default
      Removed value: -null
    • addedInput schema / properties / file / description
      Added value: +"A Python file to run instead of source, as from a shell: __file__ is its path, __name__ is \"__main__\", args are in sys.argv[1:]. The text travels once."
    • removedInput schema / properties / file / title
      Removed value: -"File"
    • addedInput schema / properties / file / type
      Added value: +"string"
    • addedInput schema / properties / globals / additionalProperties
      Added value: +true
    • removedInput schema / properties / globals / anyOf
      Removed value: -[
      -  {
      -    "additionalProperties": true,
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / globals / default
      Removed value: -null
    • addedInput schema / properties / globals / description
      Added value: +"Names that exist before the script runs, for example {\"radius\": 2.0}."
    • removedInput schema / properties / globals / title
      Removed value: -"Globals"
    • addedInput schema / properties / globals / type
      Added value: +"object"
    • removedInput schema / properties / job / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / job / default
      Removed value: -null
    • addedInput schema / properties / job / description
      Added value: +"job: the job id that background returned."
    • removedInput schema / properties / job / title
      Removed value: -"Job"
    • addedInput schema / properties / job / type
      Added value: +"string"
    • removedInput schema / properties / language / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / language / description
      Added value: +"expression: \"hscript\" or \"python\"."
    • removedInput schema / properties / language / title
      Removed value: -"Language"
    • addedInput schema / properties / language / type
      Added value: +"string"
    • removedInput schema / properties / mode / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / mode / description
      Added value: +"One of \"python\", \"hscript\", \"expression\", \"vex_check\", \"env\", \"job\"."
    • removedInput schema / properties / mode / title
      Removed value: -"Mode"
    • addedInput schema / properties / mode / type
      Added value: +"string"
    • removedInput schema / properties / name / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / name / default
      Removed value: -null
    • addedInput schema / properties / name / description
      Added value: +"env: the Houdini variable to read, for example \"HIP\"."
    • removedInput schema / properties / name / title
      Removed value: -"Name"
    • addedInput schema / properties / name / type
      Added value: +"string"
    • removedInput schema / properties / source / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / source / default
      Removed value: -null
    • addedInput schema / properties / source / description
      Added value: +"The code: Python, HScript, an expression or VEX, as mode says."
    • removedInput schema / properties / source / title
      Removed value: -"Source"
    • addedInput schema / properties / source / type
      Added value: +"string"
    • removedInput schema / properties / timeout / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / timeout / description
      Added value: +"The seconds the script may run. Past it, the script stops where it is, the answer says where, and what it changed stays."
    • removedInput schema / properties / timeout / title
      Removed value: -"Timeout"
    • addedInput schema / properties / timeout / type
      Added value: +"number"
    • removedInput schema / title
      Removed value: -"toolArguments"
  4. Addedv0.1.1

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations, it discloses that code runs with Houdini process rights, can write files, delete nodes, and quit Houdini. It also explains silent write failures and `write_warnings`, blocking behavior during execution, timeout side effects, and that background jobs refuse other calls until they end.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but front-loaded and organized by purpose, alternatives, warnings, and mode list. It is appropriately sized for a destructive multi-mode execution tool, though some sentences duplicate schema detail and the end-of-session feedback advice is slightly tangential.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity, destructive annotations, 11 parameters, and output schema, the description covers the critical gaps: modes, side effects, silent parameter-write behavior, blocking behavior, timeout semantics, and when to use alternatives. An agent has enough context to call it safely and correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents parameters thoroughly, but the description adds useful mode-specific meaning: what each mode does, that Python does not return the last line's value, how `file` and `args` relate to `sys.argv`, and the semantics of `background`, `wait`, and `timeout`.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'Run code in Houdini, with the full `hou` module and no guard.' It enumerates all supported modes and distinguishes itself from siblings by saying it is for what no other tool covers and explicitly warning against rebuilding networks that `node_edit` handles.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives explicit when-to-use guidance ('Use it for what no other tool covers', 'confirm an API in the live session') and when-not-to-use guidance ('Do not use it to build a network...', 'Prefer a named tool when one exists'). It also routes long-running work to `background` and interruption to `session action='interrupt'`.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.