Skip to main content
POST
/
v1
/
agents
/
{agent_id}
/
workspace
/
glob
Workspace: Glob
curl --request POST \
  --url https://api.xpander.ai/v1/agents/{agent_id}/workspace/glob \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "pattern": "<string>",
  "root_dir": "",
  "max_results": 1000
}
'
{
  "matches": [
    "<string>"
  ],
  "total_found": 0,
  "truncated": false
}
Find files in the per-agent workspace matching a glob pattern (e.g. **/*.py). Useful for discovering files before reading or editing them.

Path Parameters

agent_id
string
required
Agent ID (UUID)

Request Body

pattern
string
required
Glob pattern to match (e.g. **/*.py).
root_dir
string
Directory to search from, relative to the workspace root. Defaults to the workspace root when omitted.
max_results
integer
default:1000
Maximum number of matches to return.

Response

status
string
Result status (e.g., ok).
matches
array
Array of matching file paths.

Example Request

curl -X POST "https://api.xpander.ai/v1/agents/<agent-id>/workspace/glob" \
  -H "Content-Type: application/json" \
  -H "x-api-key: <your-api-key>" \
  -d '{
    "pattern": "**/*.py",
    "root_dir": "src",
    "max_results": 1000
  }'

Notes

  • Use ** to match across directory boundaries and * to match anything within a single path segment.
  • Combine with Workspace: Grep to search the contents of the matched files.

See Also

Authorizations

x-api-key
string
header
required

API Key for authentication

Path Parameters

agent_id
string
required

Body

application/json
pattern
string
required

Glob pattern for file matching. Supports ** for recursive matching, * for wildcards.

Example:

"**/*.py"

root_dir
string
default:""

Root directory to search from, relative to workspace root.

Example:

"src"

max_results
integer
default:1000

Maximum number of results to return. Prevents excessive output for broad patterns.

Required range: 1 <= x <= 50000

Response

Successful Response

matches
string[]

List of matched file paths

total_found
integer
default:0

Total number of files matching the pattern

truncated
boolean
default:false

True if results were truncated due to max_results limit