← Back to homepage

Generate Tool

Turn a Python script or natural language description into a fully parameterized ArcGIS Python toolbox (.pyt). The tool handles boilerplate, parameter inference, and packaging so you can focus on logic.

Overview

Generate Tool accepts either raw Python code or a descriptive prompt. The AI drafts the tool class, parameter definitions, and execute logic, then writes a ready-to-use .pyt file.

Usage

  1. Add the toolbox to ArcGIS Pro.
  2. Open Generate Tool.
  3. Choose whether you are supplying code or a natural language prompt.
  4. Set toolbox name, tool name, and output folder.
  5. Optionally enable advanced mode to provide explicit parameter JSON.
  6. Run the tool. A .pyt file is created and ready to add to ArcGIS Pro.

Parameters

NameTypeRequiredDescription
SourceString (Choice)YesAI provider (OpenRouter, OpenAI, Azure OpenAI, Claude, DeepSeek, Local LLM).
ModelStringNoSpecific model for the provider.
EndpointStringNoCustom endpoint for Azure or local deployments.
Deployment NameStringNoAzure OpenAI deployment ID.
Input TypeString (Choice)YesUse "Natural Language Prompt" or "Python Code".
Python CodeString (Multiline)NoPaste existing code when Input Type = Python Code.
Natural Language PromptStringNoDescribe the tool you want when Input Type = Prompt.
Toolbox NameStringYesName for the generated toolbox.
Tool NameStringYesClass name for the generated tool.
Output PathFolderYesDirectory where the .pyt file will be saved.
Advanced ModeBooleanNoEnable to supply custom parameter JSON.
Parameter Definition (JSON)String (Multiline)NoOnly used with Advanced Mode.
Output ToolboxFile (Derived)AutoPath to the generated .pyt.

How it works

  1. Input processing: Prompts are converted to Python; existing code is used as-is.
  2. Parameter inference: The AI inspects the code to infer parameters and properties.
  3. Toolbox generation: A complete .pyt is written with the correct ArcGIS class structure.
  4. Validation: Syntax and structure are checked before writing the file.

Tips

Advanced parameter definition

When Advanced Mode is enabled, provide JSON to control parameters. Example:

{
  "parameters": [
    {
      "name": "input_layer",
      "displayName": "Input Feature Layer",
      "datatype": "GPFeatureLayer",
      "parameterType": "Required",
      "direction": "Input"
    },
    {
      "name": "buffer_distance",
      "displayName": "Buffer Distance",
      "datatype": "GPLinearUnit",
      "parameterType": "Required",
      "direction": "Input"
    },
    {
      "name": "output_layer",
      "displayName": "Output Feature Layer",
      "datatype": "GPFeatureLayer",
      "parameterType": "Required",
      "direction": "Output"
    }
  ]
}

Example uses

Data privacy

Important: The code or prompt you provide is sent to the AI provider. Avoid sharing proprietary algorithms or sensitive data unless you are using a trusted, local model.