Skip to main content
Glama

classify_sector

Classify municipal bond descriptions into sectors using keyword rules. Verify that the classification is deterministic and consistent.

Instructions

Classify a muni bond issue description into a sector using the same keyword rules the calendar tool uses. Useful to show Marciano the classifier is deterministic, not a black box.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionYes

Implementation Reference

  • The classify_sector function that classifies a muni bond description into a sector using keyword rules (SECTOR_RULES). Returns 'Other / Unclassified' if no keyword matches.
    def classify_sector(description: str) -> str:
        """Classify a muni bond description into a sector. Order matters — more
        specific rules first (e.g. 'school revenue' → Education not Revenue)."""
        d = f" {description.lower()} "
        for sector, keywords in SECTOR_RULES:
            if any(k in d for k in keywords):
                return sector
        return "Other / Unclassified"
  • SECTOR_RULES list of (sector_name, [keywords]) tuples used by classify_sector. Ordered by specificity with rules for Healthcare, Housing, Education, Water/Utility, Transportation, IDB, Tobacco, Pension, Refunding, GO, and Revenue.
    SECTOR_RULES: list[tuple[str, list[str]]] = [
        ("Healthcare / Hospital", [
            "hospital", "health", "medical center", "healthcare", "nursing", "senior living"
        ]),
        ("Housing", [
            "housing", "multifamily", "single family", "residential mortgage"
        ]),
        ("Education / Schools", [
            "school", "district", "education", "university", "college", "student loan"
        ]),
        ("Water / Sewer / Utility", [
            "water", "sewer", "wastewater", "utility", "electric", "power", "gas system"
        ]),
        ("Transportation", [
            "transport", "toll", "turnpike", "bridge", "port", "airport", "aviation",
            "transit", "highway", "road", "metro"
        ]),
        ("Industrial Development / IDB", [
            "industrial development", "idb", "economic development", "development revenue"
        ]),
        ("Tobacco Settlement", ["tobacco"]),
        ("Pension / OPEB", ["pension", "opeb"]),
        ("Refunding", ["refunding"]),
        ("General Obligation", [
            "general obligation", " go ", "(go)", "unlimited tax", "limited tax",
            "school building", "public improvement"
        ]),
        ("Revenue", ["revenue"]),
    ]
  • Tool registration schema for classify_sector — takes a single required 'description' string parameter. Output is JSON with description and sector fields.
        name="classify_sector",
        description=(
            "Classify a muni bond issue description into a sector using the same "
            "keyword rules the calendar tool uses. Useful to show Marciano the "
            "classifier is deterministic, not a black box."
        ),
        inputSchema={
            "type": "object",
            "properties": {
                "description": {"type": "string"},
            },
            "required": ["description"],
        },
    ),
  • server.py:903-905 (registration)
    Dispatch handler for classify_sector in call_tool/_dispatch. Extracts 'description' from args and returns {'description': ..., 'sector': classify_sector(desc)}.
    if name == "classify_sector":
        desc = args.get("description", "")
        return {"description": desc, "sector": classify_sector(desc)}
Behavior3/5

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

No annotations provided. Description mentions 'same keyword rules' implying deterministic, but lacks details on input constraints, error behavior, or performance. Adequate for a simple tool.

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?

Two sentences, front-loaded with purpose. Every word adds value, no redundancy.

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?

For a simple tool with one parameter and no output schema, the description covers key aspects: purpose and rationale. Lacks output format info, but completeness is still high given simplicity.

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

Parameters2/5

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

Single parameter 'description' has no schema description. Description only says 'muni bond issue description' without format or examples. Schema coverage is 0%, so description should compensate but doesn't.

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?

Clearly states the action (classify) and resource (muni bond issue description). It also references the deterministic nature and distinguishes from sibling data-retrieval tools.

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?

Provides a specific use case (show Marciano the classifier is deterministic). Does not explicitly state when not to use, but context is clear for a simple classification tool.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ark9164-create/blaylock-emma-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server