Skip to main content
Glama

GoCodebook — California Building Codes

search_california_codes

Search California building codes (Title 24), state housing law and California city and county zoning/municipal codes by TOPIC, when the user does not already have a section number — e.g. "minimum attic access opening", "ADU setbacks in San Jose". Requires the user's GoCodebook account and uses 1 credit per search (also when nothing is found). If the user already cites a section number, use lookup_california_code_section instead — it is free. Returns ranked excerpts with citations and links. It does NOT decide whether a project complies.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesWhat to find, in plain words. Up to 300 characters.
sourcesNoOptional. Limit to federal law, state codes, or local ordinances.
code_editionNoOptional. Which Title 24 cycle to search; a permit filed in 2024 is enforced under "2022". Defaults to "current".
jurisdictionNoOptional. A California city or county slug ("san-jose", "marin-county") to search that place's own code together with the state codes. Omit for statewide.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "applied_question_url": {
      -      "type": "string"
      -    },
      -    "as_of": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "credits_charged": {
      -      "type": "integer"
      -    },
      -    "hint": {
      -      "description": "The search page's own notice about this query (a missing section, a zone code in the wrong city, a code the library does not hold, an address). Tell the user what it says.",
      -      "type": [
      -        "object",
      -        "null"
      -      ]
      -    },
      -    "historical": {
      -      "type": "boolean"
      -    },
      -    "message": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "query": {
      -      "properties": {
      -        "code_edition": {
      -          "enum": [
      -            "current",
      -            "2022",
      -            "2019"
      -          ],
      -          "type": "string"
      -        },
      -        "jurisdiction": {
      -          "type": "string"
      -        },
      -        "query": {
      -          "type": "string"
      -        },
      -        "sources": {
      -          "items": {
      -            "enum": [
      -              "federal",
      -              "state",
      -              "local"
      -            ],
      -            "type": "string"
      -          },
      -          "type": "array"
      -        }
      -      },
      -      "required": [
      -        "query",
      -        "jurisdiction",
      -        "code_edition"
      -      ],
      -      "type": "object"
      -    },
      -    "results": {
      -      "description": "Ranked best-first. Each excerpt is a short passage, never the whole section.",
      -      "items": {
      -        "properties": {
      -          "citation": {
      -            "description": "Cite exactly this string.",
      -            "type": "string"
      -          },
      -          "document_slug": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "document_title": {
      -            "type": "string"
      -          },
      -          "edition": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "excerpt": {
      -            "type": "string"
      -          },
      -          "excerpt_truncated": {
      -            "type": "boolean"
      -          },
      -          "heading": {
      -            "type": "string"
      -          },
      -          "section_number": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "source_url": {
      -            "description": "Link to the full section. Always show it.",
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          }
      -        },
      -        "required": [
      -          "document_title",
      -          "heading",
      -          "citation",
      -          "source_url",
      -          "excerpt",
      -          "excerpt_truncated"
      -        ],
      -        "type": "object"
      -      },
      -      "type": "array"
      -    },
      -    "section_ref": {
      -      "type": [
      -        "object",
      -        "null"
      -      ]
      -    },
      -    "status": {
      -      "description": "found / no_results: the search ran and 1 credit was charged (a search with no results still costs a credit). signin_required: the user must connect their GoCodebook account. credits_required: the account has no credits — send the user to upgrade_url. rate_limited / error: nothing ran and nothing was charged.",
      -      "enum": [
      -        "found",
      -        "no_results",
      -        "signin_required",
      -        "credits_required",
      -        "rate_limited",
      -        "error"
      -      ],
      -      "type": "string"
      -    },
      -    "upgrade_url": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    }
      -  },
      -  "required": [
      -    "status"
      -  ],
      -  "type": "object"
      -}New value: +null
  2. Added

TDQS

A4.7/5.0
Behavior5/5

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

Discloses cost behavior (1 credit per search, charged even when nothing is found), an auth prerequisite (GoCodebook account), the return shape (ranked excerpts with citations and links), and a negative guarantee ('does NOT decide whether a project complies'). Read-only is not claimed, consistent with the credit-consuming annotation.

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?

Four sentences, all load-bearing: purpose + trigger, auth/cost, routing to the sibling, return shape and non-goal. The most decision-relevant facts (topic search, no section number) are front-loaded.

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?

With no output schema and thin annotations, the description carries the burden well: it covers cost, auth, return format, and scope limits. An agent has everything needed to choose and call this tool correctly.

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 description coverage is 100%, so every parameter (query, sources, code_edition, jurisdiction) is already documented with examples and enum meanings. The description adds only the framing that queries are topical and the 300-char example style, so the 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 (search) and resource (California building codes/Title 24, state housing law, city and county zoning) with a scoping condition (by TOPIC, when no section number is known). It explicitly distinguishes itself from the sibling lookup_california_code_section. Concrete example queries further pin down what 'topic search' means.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit when-to-use trigger ('user does not already have a section number') and a when-not-to-use alternative with its own routing rule ('If the user already cites a section number, use lookup_california_code_section instead — it is free'). No inference is left to the agent.

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.

Resources