dirname
Extract the parent directory from file paths by stripping the final component. Returns JSON with the directory prefix.
Instructions
Return the parent directory portion of file paths, stripping the final component. Read-only, no side effects. Returns JSON with the directory path. Use to extract directory prefixes from full paths. Not for extracting the filename — use 'basename' for the final component. See also 'basename', 'realpath'.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"paths": "<paths>"
},
"name": "dirname"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| raw | No | Write one dirname per line without a JSON envelope. | |
| paths | Yes | Paths to transform. |