Skip to main content
Glama

Get Legislators by Location

openstates_get_legislators_by_location
Read-onlyIdempotent

Find every legislator representing a geographic coordinate — both tiers. Pass latitude and longitude to get the state senators and representatives for that location (and potentially governor/executive officials), plus the coordinate's two US Senators and its US Representative. jurisdiction.classification separates the tiers: "state" is a state legislature, "country" is the US Congress. current_role.org_classification does not — it is "upper"/"lower" for a US Senator exactly as for a state senator. Useful for constituent-to-representative matching, address-based policy research, and electoral boundary analysis. This server does not geocode addresses — the caller must provide decimal-degree coordinates. Use include=offices to get contact information alongside the legislator list.

Input Schema

NameRequiredDescriptionDefault
includeNoRelated data to inline. "offices" includes phone, fax, and address. "links" includes website and social links. "other_names" includes alternate/former names, "other_identifiers" cross-system IDs, and "sources" the provenance URLs behind the record.
latitudeYesLatitude in decimal degrees (e.g., 47.6062 for Seattle, WA).
longitudeYesLongitude in decimal degrees (e.g., -122.3321 for Seattle, WA).

Output Schema

NameRequiredDescriptionDefault
countNoNumber of legislators returned for this coordinate.
errorNoPresent when the call failed. Absent on success.
noticeNoPresent when no legislators were found — explains why (e.g., location outside US boundaries or unsupported territory).
stateCountNoResults serving a state legislature (jurisdiction.classification = "state").
legislatorsNoLegislators representing the given coordinate.
federalCountNoResults serving the US Congress (jurisdiction.classification = "country") — the coordinate's two US Senators and its US Representative.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `invalid_coordinate`: Latitude or longitude is outside valid range. `upstream_timeout`: Open States did not answer within the per-request timeout. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `invalid_coordinate`: Latitude or longitude is outside valid range. `upstream_timeout`: Open States did not answer within the per-request timeout. `rate_limited`: The shared Open States API key reached a request cap — Open States' per-minute or daily limit, or this server's own daily budget. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "invalid_coordinate",
      -  "upstream_timeout"
      -]New value: +[
      +  "invalid_coordinate",
      +  "upstream_timeout",
      +  "rate_limited"
      +]
  2. Changed1 schema field changed
    • changedOutput schema / properties / legislators / items / properties / current_role / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "district": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "description": "District label or null."
      -      },
      -      "division_id": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "description": "OCD division the district maps to (e.g., \"ocd-division/country:us/state:wa/sldu:37\"). Null when undistricted, absent when upstream omits it."
      -      },
      -      "org_classification": {
      -        "description": "Chamber classification.",
      -        "type": "string"
      -      },
      -      "title": {
      -        "description": "Role title.",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "title",
      -      "org_classification",
      -      "district"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "district": {
      +        "description": "District label or null.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "division_id": {
      +        "description": "OCD division the district maps to (e.g., \"ocd-division/country:us/state:wa/sldu:37\"). Null when undistricted, absent when upstream omits it.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "org_classification": {
      +        "description": "Chamber classification.",
      +        "type": "string"
      +      },
      +      "title": {
      +        "description": "Role title.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "title",
      +      "org_classification",
      +      "district"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  3. Changed6 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / additionalProperties
      Added value: +false
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedOutput schema / anyOf
      Added value: +[
      +  {
      +    "not": {
      +      "required": [
      +        "error"
      +      ]
      +    },
      +    "required": [
      +      "legislators",
      +      "count",
      +      "stateCount",
      +      "federalCount"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "error"
      +    ]
      +  }
      +]
    • addedOutput schema / properties / error
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "Present when the call failed. Absent on success.",
      +  "properties": {
      +    "code": {
      +      "description": "JSON-RPC error code for this failure.",
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    },
      +    "data": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "reason": {
      +          "description": "Machine-readable failure mode. Declared by this tool: `invalid_coordinate`: Latitude or longitude is outside valid range. `upstream_timeout`: Open States did not answer within the per-request timeout. Other values are possible when a failure originates below the handler.",
      +          "examples": [
      +            "invalid_coordinate",
      +            "upstream_timeout"
      +          ],
      +          "type": "string"
      +        },
      +        "recovery": {
      +          "additionalProperties": {},
      +          "description": "Actionable next step for the caller.",
      +          "properties": {
      +            "hint": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "hint"
      +          ],
      +          "type": "object"
      +        },
      +        "retryable": {
      +          "description": "Whether retrying may succeed.",
      +          "type": "boolean"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "message": {
      +      "description": "Human-readable description of what went wrong.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "code",
      +    "message"
      +  ],
      +  "type": "object"
      +}
    • removedOutput schema / required
      Removed value: -[
      -  "legislators",
      -  "count",
      -  "stateCount",
      -  "federalCount"
      -]
  4. Changed6 schema fields changed
    • changedOutput schema / properties / legislators / items / properties / family_name / description
      Previous value: -"Family (last) name."New value: +"Family (last) name. Empty string when Open States recorded none."
    • changedOutput schema / properties / legislators / items / properties / given_name / description
      Previous value: -"Given (first) name."New value: +"Given (first) name. Empty string when Open States recorded none."
    • changedOutput schema / properties / legislators / items / properties / links / items / properties / note / description
      Previous value: -"Link description."New value: +"Link description. Empty string when Open States recorded no description — common on person links."
    • changedOutput schema / properties / legislators / items / properties / openstates_url / description
      Previous value: -"Open States profile URL."New value: +"Open States profile URL. Empty string when Open States recorded none."
    • changedOutput schema / properties / legislators / items / properties / other_names / items / properties / note / description
      Previous value: -"Note describing the alternate name."New value: +"Note describing the alternate name. Empty string when Open States recorded no note."
    • changedOutput schema / properties / legislators / items / properties / sources / items / properties / note / description
      Previous value: -"Source note."New value: +"Source note. Empty string when Open States recorded no note."
  5. Changed7 schema fields changed
    • addedOutput schema / properties / federalCount
      Added value: +{
      +  "description": "Results serving the US Congress (jurisdiction.classification = \"country\") — the coordinate's two US Senators and its US Representative.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / legislators / items / properties / family_name
      Added value: +{
      +  "description": "Family (last) name.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / legislators / items / properties / given_name
      Added value: +{
      +  "description": "Given (first) name.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / legislators / items / properties / jurisdiction / properties / classification
      Added value: +{
      +  "description": "Government level this legislator serves: \"state\" for a state legislature, \"country\" for the US Congress. The field that separates the two tiers in this result set.",
      +  "type": "string"
      +}
    • changedOutput schema / properties / legislators / items / required
      Previous value: -[
      -  "id",
      -  "name",
      -  "party",
      -  "current_role",
      -  "jurisdiction",
      -  "email",
      -  "openstates_url"
      -]New value: +[
      +  "id",
      +  "name",
      +  "party",
      +  "current_role",
      +  "jurisdiction",
      +  "given_name",
      +  "family_name",
      +  "email",
      +  "openstates_url"
      +]
    • addedOutput schema / properties / stateCount
      Added value: +{
      +  "description": "Results serving a state legislature (jurisdiction.classification = \"state\").",
      +  "type": "number"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "legislators",
      -  "count"
      -]New value: +[
      +  "legislators",
      +  "count",
      +  "stateCount",
      +  "federalCount"
      +]
  6. Changed2 schema fields changed
    • changedOutput schema / properties / legislators / items / properties / current_role / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "district": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "description": "District label or null."
      -      },
      -      "org_classification": {
      -        "description": "Chamber classification.",
      -        "type": "string"
      -      },
      -      "title": {
      -        "description": "Role title.",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "title",
      -      "org_classification",
      -      "district"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "district": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "description": "District label or null."
      +      },
      +      "division_id": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "description": "OCD division the district maps to (e.g., \"ocd-division/country:us/state:wa/sldu:37\"). Null when undistricted, absent when upstream omits it."
      +      },
      +      "org_classification": {
      +        "description": "Chamber classification.",
      +        "type": "string"
      +      },
      +      "title": {
      +        "description": "Role title.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "title",
      +      "org_classification",
      +      "district"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedOutput schema / properties / legislators / items / properties / image
      Added value: +{
      +  "description": "Official headshot URL. Absent when no photo is published.",
      +  "type": "string"
      +}
  7. Changed4 schema fields changed
    • changedInput schema / properties / include / description
      Previous value: -"Related data to inline. \"offices\" includes phone, fax, and address."New value: +"Related data to inline. \"offices\" includes phone, fax, and address. \"links\" includes website and social links. \"other_names\" includes alternate/former names, \"other_identifiers\" cross-system IDs, and \"sources\" the provenance URLs behind the record."
    • addedOutput schema / properties / legislators / items / properties / other_identifiers
      Added value: +{
      +  "description": "Cross-system identifiers when include=other_identifiers is requested.",
      +  "items": {
      +    "additionalProperties": false,
      +    "description": "Alternate identifier record.",
      +    "properties": {
      +      "identifier": {
      +        "description": "Alternate identifier.",
      +        "type": "string"
      +      },
      +      "scheme": {
      +        "description": "Identifier scheme (the issuing system).",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "identifier",
      +      "scheme"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / legislators / items / properties / other_names
      Added value: +{
      +  "description": "Alternate/former names when include=other_names is requested.",
      +  "items": {
      +    "additionalProperties": false,
      +    "description": "Alternate name record.",
      +    "properties": {
      +      "name": {
      +        "description": "Alternate or former name.",
      +        "type": "string"
      +      },
      +      "note": {
      +        "description": "Note describing the alternate name.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "name",
      +      "note"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / legislators / items / properties / sources
      Added value: +{
      +  "description": "Provenance sources when include=sources is requested.",
      +  "items": {
      +    "additionalProperties": false,
      +    "description": "Source record.",
      +    "properties": {
      +      "note": {
      +        "description": "Source note.",
      +        "type": "string"
      +      },
      +      "url": {
      +        "description": "Source URL.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "url",
      +      "note"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
  8. Changed3 schema fields changed
    • changedOutput schema / properties / count / description
      Previous value: -"Number of legislators returned."New value: +"Number of legislators returned for this coordinate."
    • removedOutput schema / properties / coverage_note
      Removed value: -{
      -  "description": "Present when no legislators were found — explains why (e.g., location outside US boundaries or unsupported territory).",
      -  "type": "string"
      -}
    • addedOutput schema / properties / notice
      Added value: +{
      +  "description": "Present when no legislators were found — explains why (e.g., location outside US boundaries or unsupported territory).",
      +  "type": "string"
      +}
  9. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare read-only, idempotent, open-world behavior, so the description's added value is in the caveats: 'This server does not geocode addresses — the caller must provide decimal-degree coordinates' and the note that results may include governor/executive officials. The clarification that jurisdiction.classification rather than current_role.org_classification separates tiers is genuinely useful disambiguation not available anywhere else in the structured fields.

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

Conciseness4/5

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

Front-loaded with the core action, then caveats and hints. The two sentences dissecting jurisdiction.classification vs. current_role.org_classification are dense but earn their place by preventing a common misclassification error. Slightly long for a 3-parameter read tool.

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

Completeness4/5

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

An output schema exists, so return values need not be explained; the description instead covers the things that would trip an agent up — no geocoding, coordinate format, output variability across tiers, and how to request offices. What's missing is any statement of jurisdictional scope (e.g., whether non-US coordinates return anything), which openWorldHint leaves ambiguous.

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

Parameters3/5

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

Schema coverage is 100% and both latitude/longitude examples and the include enum meanings are already documented in the schema. The description only adds the constraint that values must be decimal degrees rather than addresses, which is marginal over what the schema already says. Baseline 3 applies.

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?

States a specific verb and resource ('Find every legislator representing a geographic coordinate') and immediately names the two tiers covered. It is clearly distinguishable from sibling search_people, which is a general people search rather than a coordinate lookup.

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?

Gives concrete use cases (constituent matching, address-based research, boundary analysis) and a conditional hint ('Use include=offices to get contact information'). However it never names a sibling alternative (e.g., search_people) for name-based lookups, so the routing guidance is implicit rather than explicit.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.