Skip to main content
Glama
lutfiArahaman

ArcGIS Pro MCP Bridge

execute_python

Run custom Python/arcpy code in a live ArcGIS Pro session to handle advanced map operations beyond standard tools. Return data by setting 'result' and capture output via print.

Instructions

Execute arbitrary Python/arcpy code inside the ArcGIS Pro bridge. Use this for complex arcpy.mp operations not covered by other tools.

Available variables: arcpy, os, proj (the ArcGISProject), get_map() Set result = in your code to return data. print() output is captured and returned as 'stdout'.

Example: code = """ m = proj.listMaps()[0] result = [lyr.name for lyr in m.listLayers()] """

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Install Server

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of disclosure. It explains the execution environment (available variables), how to return data via the result variable, and how stdout is captured, which is substantial. It does not mention potential side effects or limitations, but the arbitrary-code nature is openly stated.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficient: a one-line purpose, a brief usage directive, a compact list of available variables, and a short example. Every sentence contributes functional information without repetition or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a general-purpose code execution tool, the description covers all essential operational details: input format, environment, output mechanism, and a concrete example. The presence of an output schema further reduces the need to spell out return structures, so nothing critical is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema only names the 'code' parameter with no description, so the description adds essential meaning. It defines the parameter as executable arcpy/Python code, lists the pre-defined variables, explains the result variable convention, and gives a complete usage example.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool executes arbitrary Python/arcpy code within the ArcGIS Pro bridge, with a specific verb and resource. It also distinguishes itself from sibling tools by framing this as a fallback for operations not covered by more specialized tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says to use this tool for complex arcpy.mp operations not covered by other tools, which sets a clear boundary. It does not name specific alternative tools, but the exclusion is unambiguous, and the provided example reinforces practical usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lutfiArahaman/MCP_ALAMI1'

If you have feedback or need assistance with the MCP directory API, please join our Discord server