Skip to main content

pydantic-ai-king-county

King County, WA civic data tools for pydantic-ai agents. No API keys required.

pip install pydantic-ai-king-county

Tools

Factory Source What it does
address_to_parcel_tool() King County ArcGIS geocoder Street address → 10-digit parcel PIN
contractor_license_tool() WA L&I Verify portal Contractor license status + violations

Quick start

from pydantic_ai import Agent
from pydantic_ai_king_county import address_to_parcel_tool, contractor_license_tool

agent = Agent(
    "anthropic:claude-sonnet-4-5",
    toolsets=[address_to_parcel_tool(), contractor_license_tool()],
)

result = agent.run_sync(
    "Is there an active contractor license for 'Acme Plumbing' in WA, "
    "and what is the parcel number for 1817 Morris Ave S, Renton WA?"
)
print(result.output)

Tool reference

address_to_parcel_tool(*, max_locations=5)

Converts a King County, WA street address to its 10-digit parcel number (PIN) using the King County ArcGIS geocoder.

Input: address: str — street address, city optional but recommended. Also accepts a bare 10-digit PIN as pass-through.

Returns: ParcelResult TypedDict:

Field Type Description
action "use" | "pick" | "refine" | "reject" use = consume parcel_number; pick = show candidates; refine = try different input; reject = bad input
parcel_number str | None 10-digit PIN when action is "use" or "pick"
matched_address str | None Geocoder's canonical address
score float | None Match confidence 0–100. ≥90 is reliable
candidates list[ParcelCandidate] Ranked alternatives when action is "pick"
message str Human-readable explanation

contractor_license_tool(*, page_size=25)

Verifies Washington State contractor registration and license status via the WA L&I Verify portal.

Input: query: str — business name, license ID (e.g. MORTESL763NR), or 9-digit UBI number.

Returns: ContractorResult TypedDict:

Field Type Description
action "found" | "pick" | "none" | "reject" found = license verified; pick = multiple matches; none = not in L&I; reject = bad input
total_found int Total records in L&I database (may exceed len(results))
results list[ContractorRecord] Up to 25 matching records
message str Human-readable summary

Each ContractorRecord: license_id, business_name, contractor_type, contractor_group, status (Active/Expired/Inactive), city, state, ubi, violations (list of "safety" / "contractor"), detail_url.

Coverage

Address to parcel: All King County, WA addresses. Returns the 10-digit parcel number used by county systems.

Contractor license: All WA-licensed contractor types — construction contractors, electricians, plumbers, HVAC, roofers, and more.

Related tools

Also available as standalone CLI tools with --pipe, --schema, and tool.json:

License

MIT

Metadata

Release files for pydantic-ai-king-county 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydantic-ai-king-county 0.1.0
File Size Uploaded
pydantic_ai_king_county-0.1.0.tar.gz 7.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pydantic-ai-king-county 0.1.0
File Interpreter ABI Platform
pydantic_ai_king_county-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.1 kB

Release files / pydantic_ai_king_county-0.1.0.tar.gz

Download URL pydantic_ai_king_county-0.1.0.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
981c9ca6b3907efcae6b28126d20acfec2d3e527a33b0e493177549c9842ca03
BLAKE2b-256 checksum
How to use checksums
e887293d7ea35888c3de13816f4267f02f2cda7af67c6c953caa6a56eeeae253
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / pydantic_ai_king_county-0.1.0-py3-none-any.whl

Download URL pydantic_ai_king_county-0.1.0-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f6d7ec5506f07bd33f2f71da054ce336f2ea57d9f89505d5fcecf2ed92be5a8a
BLAKE2b-256 checksum
How to use checksums
0e09b8193b9cb0875ef5fcf0cc770483f392da553a7c8525ae7b681dafddecc0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page