Skip to main content

Get GP Task Definition

The get_gp_task_definition tool fetches the description and the input and output JSON schemas of a single geoprocessing task in a GPServer. An agent typically calls it before running the task, so that it knows which parameters the task accepts and what the response will contain.

Note:

This tool is always included in the default catalog. A custom catalog includes it only when the catalog contains a custom MCP tool from a web tool. For details, see Expose a web tool as a custom MCP tool.

Tool name

get_gp_task_definition

Tool alias

Get GP Task Definition

Objective

Retrieve the description and input/output schemas of a specific GPServer task—used as a preparatory step before constructing a valid task-execution request.

Usage guidance

get_gp_task_definition fetches a GPServer task definition and returns its description along with its input and output JSON schemas. The description tells you, in plain language, what the task does.

Use before running a GP task

Call get_gp_task_definition before running a GP task. The returned inputSchema identifies the parameters the task accepts and their types, which the agent needs to construct a valid request. When the agent runs the task, it passes the name of a field from this schema as the inputSchemaField argument to confirm that it retrieved the task definition first. The returned description, when present, explains what the task does in plain language, which is useful for relaying to the user or for selecting parameter values.

If the task runs asynchronously, the agent checks its progress with Get GP Task Job Status only when the user prompts it.

Point to the task URL

Important:

taskUrl must point to the specific task, not the GPServer

The taskUrl parameter must point to a specific task within a GPServer, not to the GPServer itself. URL-encode task names that contain spaces.

For example, the task URL for a task named Query Development Project Applications might look like:

https://<domain>/<server-context>/rest/services/Query_Development_Project_Applications/GPServer/Query%20Development%20Project%20Applications

When to use

  • The agent needs to know which parameters a GP task accepts, and their types, before running it.

  • The agent needs the task's description to confirm it does what the user asked for, or to relay the description back to the user.

When not to use

  • The agent already has the task's input and output schemas from a previous call. It does not need to retrieve them again for the same task within a session.

  • The agent needs the status of a running job, not the task's metadata. Use Get GP Task Job Status instead.