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

TableJSON 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

TableJSON 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. 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"
      +  }
      +]
  2. 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"
      -]
  3. 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."
  4. 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"
      +]
  5. 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"
      +}
  6. 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"
      +}
  7. 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"
      +}
  8. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already mark the tool read-only and idempotent; the description goes further by explaining the two-tier return behavior, the distinction between jurisdiction.classification and current_role.org_classification, and the no-geocoding constraint. This is meaningful behavioral context beyond the structured metadata.

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 front-loaded with the core purpose, then gives essential caveats and use cases. Every sentence contributes either to selecting the tool, calling it correctly, or understanding its output, with no redundant 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?

Given the output schema exists, schema coverage is complete, and annotations cover safety, the description supplies the remaining needed context: tier semantics, coordinate requirements, optional include behavior, and practical use cases. Nothing critical for invoking the tool correctly is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description adds value with concrete latitude/longitude examples, clarifies that the caller must supply decimal-degree coordinates, and highlights the include=offices option for contact data. This goes beyond simply restating the schema.

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 states a specific verb and resource: 'Find every legislator representing a geographic coordinate — both tiers.' It clearly distinguishes the tool from sibling lookup/search tools by describing what it returns, including state legislators, US Senators, and the US Representative, and by noting the key classification distinction.

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 gives explicit use cases ('constituent-to-representative matching, address-based policy research, and electoral boundary analysis') and a clear limitation ('This server does not geocode addresses'). It does not explicitly name alternative tools or say when not to use them, but the context is clear enough.

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.