> ## Documentation Index
> Fetch the complete documentation index at: https://graph.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# exec tools

> Runs a command.

Runs a command. stdout becomes the result; a non-zero exit, a timeout or unparseable JSON is a tool error. Exec tools run arbitrary code, by design.

These fields go alongside the [common fields](/tools/reference/tool-file#common-fields), with `kind: exec`.

## Fields

**command** `string` *required*

The executable.

**args** `string[]`

Arguments, as templates over `{{input.*}}`.

**env** `map\<string, string\>`

Extra environment variables. Values expand `${VAR}` from graph's environment, and `${VAR:-default}` falls back when it's unset or empty.

**cwd** `string`

Working directory for the process.

**timeout\_secs** `integer` (default: 60)

Seconds before the process is killed.

**output** `enum\<string\>` (default: json)

`json` parses stdout as JSON; `text` returns it as `{text}`.

Available options: `json`, `text`

```yaml Example theme={null}
version: 2
name: open_prs
description: Open pull requests in the current repository, newest first.
kind: exec
command: gh
args:
- pr
- list
- --state
- open
- --json
- number,title,author
- --limit
- '{{input.limit}}'
read_only: true
input_schema:
  type: object
  required:
  - limit
  properties:
    limit:
      type: integer
      description: Most pull requests to return
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.