{
  "openapi": "3.1.0",
  "info": {
    "title": "Geoapify MCP Tool: Places: Filter Reachable Places",
    "version": "1.3.0",
    "description": "AI-focused, tool-specific OpenAPI specification for filter_reachable_places 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": "Places",
      "description": "Places MCP tools."
    }
  ],
  "paths": {
    "/mcp": {
      "post": {
        "tags": [
          "Places"
        ],
        "operationId": "callFilterReachablePlaces",
        "summary": "Places: Filter Reachable Places",
        "description": "Use this tool to filter supplied place coordinates by membership in a travel-time or travel-distance isoline from one origin. Returns matching coordinates and their original zero-based indexes. Includes boundary points and excludes polygon holes. Does not search for places or calculate per-place journey times; use search_reachable_places for discovery or calculate_route_matrix for journey costs.",
        "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/FilterReachablePlacesToolCallRequest"
              },
              "examples": {
                "filterReachablePlacesTime": {
                  "summary": "Filter supplied coordinates by a 15-minute drive",
                  "value": {
                    "jsonrpc": "2.0",
                    "id": 1,
                    "method": "tools/call",
                    "params": {
                      "name": "filter_reachable_places",
                      "arguments": {
                        "origin": {
                          "lat": 36.9743711,
                          "lon": -76.4166222
                        },
                        "type": "time",
                        "range": 900,
                        "mode": "drive",
                        "places": [
                          {
                            "lat": 36.98,
                            "lon": -76.42
                          },
                          {
                            "lat": 37.12,
                            "lon": -76.65
                          }
                        ]
                      }
                    }
                  }
                },
                "filterReachablePlacesDistance": {
                  "summary": "Filter supplied coordinates by a 5-kilometer bicycle ride",
                  "value": {
                    "jsonrpc": "2.0",
                    "id": 2,
                    "method": "tools/call",
                    "params": {
                      "name": "filter_reachable_places",
                      "arguments": {
                        "origin": {
                          "lat": 36.9743711,
                          "lon": -76.4166222
                        },
                        "type": "distance",
                        "range": 5000,
                        "mode": "bicycle",
                        "places": [
                          {
                            "lat": 36.98,
                            "lon": -76.42
                          }
                        ],
                        "include_geometry": true
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response for the filter_reachable_places MCP tool. Tool execution and validation failures also use HTTP 200 with result.isError set to true.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilterReachablePlacesToolCallResponse"
                },
                "examples": {
                  "filterReachablePlacesSuccess": {
                    "summary": "Reachable subset of supplied places",
                    "description": "Illustrative response identifying matching coordinates by their original indexes.",
                    "value": {
                      "jsonrpc": "2.0",
                      "id": 1,
                      "result": {
                        "content": [
                          {
                            "type": "text",
                            "text": "{\"reachability\":{\"origin\":{\"lat\":36.9743711,\"lon\":-76.4166222},\"type\":\"time\",\"range\":900,\"range_units\":\"seconds\",\"mode\":\"drive\",\"units\":\"metric\",\"route_type\":\"balanced\",\"traffic\":\"free_flow\"},\"total_count\":2,\"count\":1,\"excluded_count\":1,\"results\":[{\"index\":0,\"lat\":36.98,\"lon\":-76.42}]}"
                          }
                        ],
                        "structuredContent": {
                          "reachability": {
                            "origin": {
                              "lat": 36.9743711,
                              "lon": -76.4166222
                            },
                            "type": "time",
                            "range": 900,
                            "range_units": "seconds",
                            "mode": "drive",
                            "units": "metric",
                            "route_type": "balanced",
                            "traffic": "free_flow"
                          },
                          "total_count": 2,
                          "count": 1,
                          "excluded_count": 1,
                          "results": [
                            {
                              "index": 0,
                              "lat": 36.98,
                              "lon": -76.42
                            }
                          ]
                        },
                        "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": "filter_reachable_places",
        "x-geoapify-mcp-input-schema": "#/components/schemas/FilterReachablePlacesInput",
        "x-geoapify-mcp-output-schema": "#/components/schemas/FilterReachablePlacesOutput"
      }
    }
  },
  "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."
          }
        }
      },
      "FilterReachablePlacesInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "origin",
          "type",
          "range",
          "places"
        ],
        "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."
          },
          "range": {
            "type": "number",
            "minimum": 1,
            "description": "Travel limit in seconds for time, meters for metric distance, or miles for imperial distance. Gateway account limits apply."
          },
          "places": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "lat",
                "lon"
              ],
              "properties": {
                "lat": {
                  "type": "number",
                  "minimum": -90,
                  "maximum": 90
                },
                "lon": {
                  "type": "number",
                  "minimum": -180,
                  "maximum": 180
                }
              }
            },
            "description": "Supplied place coordinates in their original order. Results identify matches by zero-based index. Pass coordinates only; retain your records locally."
          },
          "include_geometry": {
            "type": "boolean",
            "default": false,
            "description": "Include the calculated isoline GeoJSON FeatureCollection."
          }
        }
      },
      "FilterReachablePlacesOutput": {
        "type": "object",
        "required": [
          "reachability",
          "total_count",
          "count",
          "excluded_count",
          "results"
        ],
        "properties": {
          "reachability": {
            "type": "object",
            "required": [
              "origin",
              "type",
              "range",
              "range_units",
              "mode",
              "units",
              "route_type",
              "traffic"
            ],
            "properties": {
              "origin": {
                "type": "object",
                "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."
              },
              "range": {
                "type": "number",
                "minimum": 1,
                "description": "Travel limit in seconds for time, meters for metric distance, or miles for imperial distance. Gateway account limits apply."
              },
              "range_units": {
                "type": "string",
                "enum": [
                  "seconds",
                  "meters",
                  "miles"
                ]
              }
            }
          },
          "total_count": {
            "type": "integer",
            "minimum": 0
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "excluded_count": {
            "type": "integer",
            "minimum": 0
          },
          "results": {
            "type": "array",
            "description": "Matching coordinates in original input order, including boundary points. Points in polygon holes are excluded.",
            "items": {
              "type": "object",
              "required": [
                "index",
                "lat",
                "lon"
              ],
              "properties": {
                "index": {
                  "type": "integer",
                  "minimum": 0
                },
                "lat": {
                  "type": "number",
                  "minimum": -90,
                  "maximum": 90
                },
                "lon": {
                  "type": "number",
                  "minimum": -180,
                  "maximum": 180
                }
              }
            }
          },
          "isoline": {
            "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."
          }
        }
      },
      "FilterReachablePlacesToolCallParams": {
        "type": "object",
        "description": "MCP tools/call params for filter_reachable_places.",
        "additionalProperties": false,
        "required": [
          "name",
          "arguments"
        ],
        "properties": {
          "name": {
            "description": "Registered MCP tool name.",
            "const": "filter_reachable_places"
          },
          "arguments": {
            "description": "Arguments validated by the filter_reachable_places input schema.",
            "$ref": "#/components/schemas/FilterReachablePlacesInput"
          }
        }
      },
      "FilterReachablePlacesToolCallRequest": {
        "type": "object",
        "description": "JSON-RPC tools/call request for the filter_reachable_places 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 filter_reachable_places.",
            "$ref": "#/components/schemas/FilterReachablePlacesToolCallParams"
          }
        },
        "examples": [
          {
            "jsonrpc": "2.0",
            "id": 1,
            "method": "tools/call",
            "params": {
              "name": "filter_reachable_places",
              "arguments": {
                "origin": {
                  "lat": 36.9743711,
                  "lon": -76.4166222
                },
                "type": "time",
                "range": 900,
                "mode": "drive",
                "places": [
                  {
                    "lat": 36.98,
                    "lon": -76.42
                  },
                  {
                    "lat": 37.12,
                    "lon": -76.65
                  }
                ]
              }
            }
          },
          {
            "jsonrpc": "2.0",
            "id": 2,
            "method": "tools/call",
            "params": {
              "name": "filter_reachable_places",
              "arguments": {
                "origin": {
                  "lat": 36.9743711,
                  "lon": -76.4166222
                },
                "type": "distance",
                "range": 5000,
                "mode": "bicycle",
                "places": [
                  {
                    "lat": 36.98,
                    "lon": -76.42
                  }
                ],
                "include_geometry": true
              }
            }
          }
        ],
        "x-geoapify-mcp-tool": "filter_reachable_places",
        "x-geoapify-mcp-category": "Places",
        "x-geoapify-mcp-input-schema": "#/components/schemas/FilterReachablePlacesInput",
        "x-geoapify-mcp-output-schema": "#/components/schemas/FilterReachablePlacesOutput"
      },
      "FilterReachablePlacesToolCallSuccessResponse": {
        "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/FilterReachablePlacesOutput"
              },
              "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
              }
            }
          }
        }
      },
      "FilterReachablePlacesToolCallResponse": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/FilterReachablePlacesToolCallSuccessResponse"
          },
          {
            "$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": []
    }
  ]
}
