{
  "openapi": "3.1.0",
  "info": {
    "title": "Geoapify MCP Tool: Routing: Calculate Isoline",
    "version": "1.3.0",
    "description": "AI-focused, tool-specific OpenAPI specification for calculate_isoline over the Geoapify JSON-RPC transport. Import this specification when an integration needs this tool without the full MCP catalog.",
    "contact": {
      "name": "Geoapify",
      "url": "https://geoapify.com",
      "email": "info@geoapify.com"
    }
  },
  "servers": [
    {
      "url": "https://api.geoapify.com/v1",
      "description": "Default API endpoint."
    },
    {
      "url": "https://api-eu.geoapify.com/v1",
      "description": "EU-focused endpoint. Geoapify service processing uses EU infrastructure."
    }
  ],
  "tags": [
    {
      "name": "Routing",
      "description": "Routing MCP tools."
    }
  ],
  "paths": {
    "/mcp": {
      "post": {
        "tags": [
          "Routing"
        ],
        "operationId": "callCalculateIsoline",
        "summary": "Routing: Calculate Isoline",
        "description": "Use this tool to calculate areas reachable from one origin within travel-time or travel-distance limits (isochrones or isodistances). Returns GeoJSON polygons, not per-destination journey times. Transit modes support time only. Use search_reachable_places to discover places inside one reachable area or filter_reachable_places to filter supplied coordinates.",
        "parameters": [
          {
            "name": "MCP-Protocol-Version",
            "in": "header",
            "required": false,
            "description": "Optional protocol version. Defaults to 2025-06-18 when omitted; explicitly unsupported versions are rejected.",
            "schema": {
              "type": "string",
              "enum": [
                "2025-06-18"
              ]
            },
            "example": "2025-06-18"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalculateIsolineToolCallRequest"
              },
              "examples": {
                "calculateIsolineTime": {
                  "summary": "Calculate a 15-minute driving area",
                  "value": {
                    "jsonrpc": "2.0",
                    "id": 1,
                    "method": "tools/call",
                    "params": {
                      "name": "calculate_isoline",
                      "arguments": {
                        "origin": {
                          "lat": 36.9743711,
                          "lon": -76.4166222
                        },
                        "type": "time",
                        "ranges": [
                          900
                        ],
                        "mode": "drive"
                      }
                    }
                  }
                },
                "calculateIsolineDistance": {
                  "summary": "Compare one- and two-mile walking areas",
                  "value": {
                    "jsonrpc": "2.0",
                    "id": 2,
                    "method": "tools/call",
                    "params": {
                      "name": "calculate_isoline",
                      "arguments": {
                        "origin": {
                          "lat": 36.9743711,
                          "lon": -76.4166222
                        },
                        "type": "distance",
                        "ranges": [
                          1,
                          2
                        ],
                        "mode": "walk",
                        "units": "imperial"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response for the calculate_isoline MCP tool. Tool execution and validation failures also use HTTP 200 with result.isError set to true.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalculateIsolineToolCallResponse"
                },
                "examples": {
                  "calculateIsolineSuccess": {
                    "summary": "Reachable areas",
                    "description": "Illustrative response with simplified polygon coordinates for a 15-minute drive.",
                    "value": {
                      "jsonrpc": "2.0",
                      "id": 1,
                      "result": {
                        "content": [
                          {
                            "type": "text",
                            "text": "{\"type\":\"FeatureCollection\",\"properties\":{\"id\":\"768fc88900268ab0ec5aa67fbfa09cc2\"},\"features\":[{\"type\":\"Feature\",\"properties\":{\"lat\":36.9743711,\"lon\":-76.4166222,\"mode\":\"drive\",\"type\":\"time\",\"range\":900,\"id\":\"768fc88900268ab0ec5aa67fbfa09cc2\"},\"geometry\":{\"type\":\"MultiPolygon\",\"coordinates\":[[[[-76.44,36.97],[-76.42,36.95],[-76.39,36.97],[-76.41,36.99],[-76.44,36.97]]],[[[-76.38,36.975],[-76.37,36.97],[-76.365,36.98],[-76.375,36.985],[-76.38,36.975]]]]}}]}"
                          }
                        ],
                        "structuredContent": {
                          "type": "FeatureCollection",
                          "properties": {
                            "id": "768fc88900268ab0ec5aa67fbfa09cc2"
                          },
                          "features": [
                            {
                              "type": "Feature",
                              "properties": {
                                "lat": 36.9743711,
                                "lon": -76.4166222,
                                "mode": "drive",
                                "type": "time",
                                "range": 900,
                                "id": "768fc88900268ab0ec5aa67fbfa09cc2"
                              },
                              "geometry": {
                                "type": "MultiPolygon",
                                "coordinates": [
                                  [
                                    [
                                      [
                                        -76.44,
                                        36.97
                                      ],
                                      [
                                        -76.42,
                                        36.95
                                      ],
                                      [
                                        -76.39,
                                        36.97
                                      ],
                                      [
                                        -76.41,
                                        36.99
                                      ],
                                      [
                                        -76.44,
                                        36.97
                                      ]
                                    ]
                                  ],
                                  [
                                    [
                                      [
                                        -76.38,
                                        36.975
                                      ],
                                      [
                                        -76.37,
                                        36.97
                                      ],
                                      [
                                        -76.365,
                                        36.98
                                      ],
                                      [
                                        -76.375,
                                        36.985
                                      ],
                                      [
                                        -76.38,
                                        36.975
                                      ]
                                    ]
                                  ]
                                ]
                              }
                            }
                          ]
                        },
                        "isError": false
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid HTTP request or unsupported MCP protocol version. Tool validation errors are returned with HTTP 200 and result.isError set to true.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GatewayError"
                },
                "example": {
                  "statusCode": 400,
                  "error": "Bad Request",
                  "message": "MCP-Protocol-Version header must be \"2025-06-18\""
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Geoapify API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GatewayError"
                },
                "example": {
                  "statusCode": 401,
                  "error": "Unauthorized",
                  "message": "Invalid apiKey"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or quota exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GatewayError"
                },
                "example": {
                  "statusCode": 429,
                  "error": "Too Many Requests",
                  "message": "Quota exceeded"
                }
              }
            }
          },
          "500": {
            "description": "Internal gateway error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GatewayError"
                },
                "example": {
                  "statusCode": 500,
                  "error": "Internal Server Error",
                  "message": "Request failed, please try again later"
                }
              }
            }
          }
        },
        "x-geoapify-mcp-tool": "calculate_isoline",
        "x-geoapify-mcp-input-schema": "#/components/schemas/CalculateIsolineInput",
        "x-geoapify-mcp-output-schema": "#/components/schemas/CalculateIsolineOutput"
      }
    }
  },
  "components": {
    "schemas": {
      "JsonRpcId": {
        "description": "JSON-RPC request identifier. The server echoes this value in the response.",
        "oneOf": [
          {
            "type": "string"
          },
          {
            "type": "integer"
          },
          {
            "type": "null"
          }
        ]
      },
      "JsonRpcError": {
        "type": "object",
        "description": "JSON-RPC error object.",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "description": "JSON-RPC error code, such as -32600 for an invalid request, -32601 for an unknown method, or -32602 for invalid parameters."
          },
          "message": {
            "type": "string",
            "description": "Human-readable JSON-RPC error message."
          },
          "data": {
            "description": "Optional machine-readable error details."
          }
        }
      },
      "JsonRpcErrorResponse": {
        "type": "object",
        "description": "JSON-RPC error response returned for invalid requests or unknown methods.",
        "required": [
          "jsonrpc",
          "id",
          "error"
        ],
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "$ref": "#/components/schemas/JsonRpcId"
          },
          "error": {
            "$ref": "#/components/schemas/JsonRpcError"
          }
        }
      },
      "GatewayError": {
        "type": "object",
        "description": "HTTP gateway error returned before or outside JSON-RPC tool execution.",
        "required": [
          "statusCode",
          "error",
          "message"
        ],
        "properties": {
          "statusCode": {
            "type": "integer",
            "description": "HTTP status code."
          },
          "error": {
            "type": "string",
            "description": "HTTP error name."
          },
          "message": {
            "type": "string",
            "description": "Human-readable error message."
          }
        }
      },
      "CalculateIsolineInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "origin",
          "type",
          "ranges"
        ],
        "properties": {
          "origin": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "lat",
              "lon"
            ],
            "properties": {
              "lat": {
                "type": "number",
                "minimum": -90,
                "maximum": 90
              },
              "lon": {
                "type": "number",
                "minimum": -180,
                "maximum": 180
              }
            },
            "description": "Origin from which travel reachability is calculated."
          },
          "type": {
            "type": "string",
            "enum": [
              "time",
              "distance"
            ],
            "description": "Time in seconds, or distance in meters (metric) or miles (imperial)."
          },
          "mode": {
            "type": "string",
            "enum": [
              "drive",
              "light_truck",
              "medium_truck",
              "truck",
              "heavy_truck",
              "truck_dangerous_goods",
              "long_truck",
              "bus",
              "scooter",
              "motorcycle",
              "bicycle",
              "mountain_bike",
              "road_bike",
              "walk",
              "hike",
              "transit",
              "approximated_transit"
            ],
            "default": "drive",
            "description": "Travel or vehicle mode."
          },
          "units": {
            "type": "string",
            "enum": [
              "metric",
              "imperial"
            ],
            "default": "metric"
          },
          "route_type": {
            "type": "string",
            "enum": [
              "balanced",
              "short",
              "less_maneuvers"
            ],
            "default": "balanced"
          },
          "traffic": {
            "type": "string",
            "enum": [
              "free_flow",
              "approximated"
            ],
            "default": "free_flow"
          },
          "avoid": {
            "type": "array",
            "maxItems": 3,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "tolls",
                "ferries",
                "highways"
              ]
            }
          },
          "max_speed": {
            "type": "number",
            "minimum": 6.5,
            "maximum": 252,
            "description": "Maximum speed: 10–252 km/h for metric, or 6.5–155 mph for imperial."
          },
          "ranges": {
            "type": "array",
            "minItems": 1,
            "maxItems": 10,
            "items": {
              "type": "number",
              "minimum": 1,
              "description": "Travel limit in seconds for time, meters for metric distance, or miles for imperial distance. Gateway account limits apply."
            },
            "description": "One to ten travel limits. Duplicate ranges are removed and results are sorted by increasing range."
          }
        }
      },
      "CalculateIsolineOutput": {
        "type": "object",
        "description": "GeoJSON FeatureCollection with one Polygon or MultiPolygon Feature per requested range, or no features when no area is reachable. Collection and feature properties contain the isoline ID; feature properties identify the origin, mode, type, and range."
      },
      "CalculateIsolineToolCallParams": {
        "type": "object",
        "description": "MCP tools/call params for calculate_isoline.",
        "additionalProperties": false,
        "required": [
          "name",
          "arguments"
        ],
        "properties": {
          "name": {
            "description": "Registered MCP tool name.",
            "const": "calculate_isoline"
          },
          "arguments": {
            "description": "Arguments validated by the calculate_isoline input schema.",
            "$ref": "#/components/schemas/CalculateIsolineInput"
          }
        }
      },
      "CalculateIsolineToolCallRequest": {
        "type": "object",
        "description": "JSON-RPC tools/call request for the calculate_isoline MCP tool.",
        "additionalProperties": false,
        "required": [
          "jsonrpc",
          "id",
          "method",
          "params"
        ],
        "properties": {
          "jsonrpc": {
            "description": "JSON-RPC protocol version.",
            "const": "2.0"
          },
          "id": {
            "description": "Client-supplied JSON-RPC request id echoed in the response.",
            "$ref": "#/components/schemas/JsonRpcId"
          },
          "method": {
            "description": "MCP method used to call a tool.",
            "const": "tools/call"
          },
          "params": {
            "description": "Tool call parameters for calculate_isoline.",
            "$ref": "#/components/schemas/CalculateIsolineToolCallParams"
          }
        },
        "examples": [
          {
            "jsonrpc": "2.0",
            "id": 1,
            "method": "tools/call",
            "params": {
              "name": "calculate_isoline",
              "arguments": {
                "origin": {
                  "lat": 36.9743711,
                  "lon": -76.4166222
                },
                "type": "time",
                "ranges": [
                  900
                ],
                "mode": "drive"
              }
            }
          },
          {
            "jsonrpc": "2.0",
            "id": 2,
            "method": "tools/call",
            "params": {
              "name": "calculate_isoline",
              "arguments": {
                "origin": {
                  "lat": 36.9743711,
                  "lon": -76.4166222
                },
                "type": "distance",
                "ranges": [
                  1,
                  2
                ],
                "mode": "walk",
                "units": "imperial"
              }
            }
          }
        ],
        "x-geoapify-mcp-tool": "calculate_isoline",
        "x-geoapify-mcp-category": "Routing",
        "x-geoapify-mcp-input-schema": "#/components/schemas/CalculateIsolineInput",
        "x-geoapify-mcp-output-schema": "#/components/schemas/CalculateIsolineOutput"
      },
      "CalculateIsolineToolCallSuccessResponse": {
        "type": "object",
        "description": "Successful JSON-RPC response with tool-specific structured content.",
        "required": [
          "jsonrpc",
          "id",
          "result"
        ],
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "$ref": "#/components/schemas/JsonRpcId"
          },
          "result": {
            "type": "object",
            "required": [
              "content",
              "structuredContent",
              "isError"
            ],
            "properties": {
              "content": {
                "type": "array",
                "description": "JSON text representation of structuredContent.",
                "items": {
                  "type": "object",
                  "required": [
                    "type",
                    "text"
                  ],
                  "properties": {
                    "type": {
                      "const": "text"
                    },
                    "text": {
                      "type": "string",
                      "description": "JSON-encoded copy of structuredContent."
                    }
                  }
                }
              },
              "structuredContent": {
                "$ref": "#/components/schemas/CalculateIsolineOutput"
              },
              "isError": {
                "const": false
              }
            }
          }
        }
      },
      "ToolCallErrorResponse": {
        "type": "object",
        "description": "JSON-RPC tools/call response when tool execution fails.",
        "required": [
          "jsonrpc",
          "id",
          "result"
        ],
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "$ref": "#/components/schemas/JsonRpcId"
          },
          "result": {
            "type": "object",
            "required": [
              "content",
              "isError"
            ],
            "properties": {
              "content": {
                "type": "array",
                "description": "Tool error details represented as JSON text.",
                "items": {
                  "type": "object",
                  "required": [
                    "type",
                    "text"
                  ],
                  "properties": {
                    "type": {
                      "const": "text"
                    },
                    "text": {
                      "type": "string",
                      "description": "JSON-encoded GatewayError with statusCode, error, and message fields."
                    }
                  }
                }
              },
              "isError": {
                "const": true
              }
            }
          }
        }
      },
      "CalculateIsolineToolCallResponse": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/CalculateIsolineToolCallSuccessResponse"
          },
          {
            "$ref": "#/components/schemas/ToolCallErrorResponse"
          },
          {
            "$ref": "#/components/schemas/JsonRpcErrorResponse"
          }
        ]
      }
    },
    "securitySchemes": {
      "ApiKeyInHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Geoapify API key header. Recommended authentication method for MCP clients."
      }
    }
  },
  "x-geoapify-mcp-tool-index": "index.json",
  "security": [
    {
      "ApiKeyInHeader": []
    }
  ]
}
