Skip to main content
Glama
stringtheoryaccelerator

Maine Burn Permit MCP Server

Check Fire Danger

check_fire_danger

Check current fire danger ratings for Maine towns to determine if burning is permitted, using real-time data from official fire weather systems.

Instructions

Checks the current fire danger rating for a specific town in Maine to see if burning is allowed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
townYesThe name of the town to check fire danger for

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteYes
zoneIdYes
humidityYes
windSpeedYes
stationNameYes
temperatureYes
burningIndexYes
fireMoisture1hrYes
fireMoisture10hrYes
fireMoisture100hrYes

Implementation Reference

  • Handler function that launches a headless Puppeteer browser, scrapes the Maine Fire Weather website to find the station for the given town, retrieves fire danger and weather data, and returns a structured response with text summary and data object.
    async (args) => {
        const { town } = args;
    
    let browser;
    try {
        browser = await puppeteer.launch({
            headless: true,
            args: ["--no-sandbox", "--disable-setuid-sandbox"],
        });
        const page = await browser.newPage();
        await page.goto(FIRE_DANGER_URL, { waitUntil: "networkidle0" });
    
        // Extract the STA object from the page script
        const staData = await page.evaluate(() => {
            // @ts-ignore
            return typeof STA !== 'undefined' ? STA : null;
        });
    
        if (!staData || !staData.stations) {
            return {
                content: [
                    {
                        type: "text",
                        text: "Could not retrieve station data from Maine Fire Weather website.",
                    },
                ],
                isError: true,
            };
        }
    
        // Find station by name (case-insensitive partial match)
        const stations = Object.values(staData.stations) as any[];
        const station = stations.find((s: any) =>
            s.station_name.toLowerCase().includes(town.toLowerCase())
        );
    
        if (!station) {
            const availableStations = stations.map((s: any) => s.station_name).join(", ");
            return {
                content: [
                    {
                        type: "text",
                        text: `Could not find a weather station matching "${town}". Available stations: ${availableStations}. Please try one of these locations.`,
                    },
                ],
            };
        }
    
        // Navigate to specific station page
        const stationUrl = `${FIRE_DANGER_URL}?station=${station.source_id}`;
        await page.goto(stationUrl, { waitUntil: "networkidle0" });
    
        const currentStationData = await page.evaluate(() => {
            // @ts-ignore
            return typeof STA !== 'undefined' ? STA.currentStation : null;
        });
    
        if (!currentStationData || !currentStationData.firedanger) {
            return {
                content: [
                    {
                        type: "text",
                        text: `Could not retrieve fire danger data for ${station.station_name}.`,
                    },
                ],
                isError: true,
            };
        }
    
        const fd = currentStationData.firedanger;
        const weather = currentStationData.weather;
    
        const output = {
            stationName: station.station_name,
            zoneId: station.zoneid.toString(),
            burningIndex: fd.bi.toString(),
            fireMoisture1hr: fd.fm1.toString(),
            fireMoisture10hr: fd.fm10.toString(),
            fireMoisture100hr: fd.fm100.toString(),
            temperature: `${weather.dry_temp}°F`,
            humidity: `${weather.rh}%`,
            windSpeed: `${weather.wind_sp} mph`,
            note: `Please verify the official Class Day (Low/Moderate/High) on the main map at ${FIRE_DANGER_URL} before burning.`,
        };
    
        return {
            content: [
                {
                    type: "text",
                    text: `Fire Weather Data for ${output.stationName} (Zone ${output.zoneId}):\n` +
                        `Burning Index: ${output.burningIndex}\n` +
                        `Fire Moisture (1-hr): ${output.fireMoisture1hr}\n` +
                        `Fire Moisture (10-hr): ${output.fireMoisture10hr}\n` +
                        `Fire Moisture (100-hr): ${output.fireMoisture100hr}\n` +
                        `Weather: ${output.temperature}, RH ${output.humidity}, Wind ${output.windSpeed}\n` +
                        `\nNote: ${output.note}`,
                },
            ],
            structuredContent: output,
        };
    
    } catch (error: any) {
        return {
            content: [
                {
                    type: "text",
                    text: `Error checking fire danger: ${error.message}`,
                },
            ],
            isError: true,
        };
    } finally {
        if (browser) {
            await browser.close();
        }
    }
  • Zod schemas defining the input (town name) and output (station details, fire indices, weather data, note) for the tool.
    inputSchema: {
        town: z.string().describe("The name of the town to check fire danger for"),
    },
    outputSchema: {
        stationName: z.string(),
        zoneId: z.string(),
        burningIndex: z.string(),
        fireMoisture1hr: z.string(),
        fireMoisture10hr: z.string(),
        fireMoisture100hr: z.string(),
        temperature: z.string(),
        humidity: z.string(),
        windSpeed: z.string(),
        note: z.string(),
    },
  • Function to register the 'check_fire_danger' tool on the MCP server, including schema and handler.
    export function registerFireDangerTool(server: McpServer) {
        server.registerTool(
            "check_fire_danger",
            {
                title: "Check Fire Danger",
                description: "Checks the current fire danger rating for a specific town in Maine to see if burning is allowed.",
                inputSchema: {
                    town: z.string().describe("The name of the town to check fire danger for"),
                },
                outputSchema: {
                    stationName: z.string(),
                    zoneId: z.string(),
                    burningIndex: z.string(),
                    fireMoisture1hr: z.string(),
                    fireMoisture10hr: z.string(),
                    fireMoisture100hr: z.string(),
                    temperature: z.string(),
                    humidity: z.string(),
                    windSpeed: z.string(),
                    note: z.string(),
                },
            },
            async (args) => {
                const { town } = args;
    
            let browser;
            try {
                browser = await puppeteer.launch({
                    headless: true,
                    args: ["--no-sandbox", "--disable-setuid-sandbox"],
                });
                const page = await browser.newPage();
                await page.goto(FIRE_DANGER_URL, { waitUntil: "networkidle0" });
    
                // Extract the STA object from the page script
                const staData = await page.evaluate(() => {
                    // @ts-ignore
                    return typeof STA !== 'undefined' ? STA : null;
                });
    
                if (!staData || !staData.stations) {
                    return {
                        content: [
                            {
                                type: "text",
                                text: "Could not retrieve station data from Maine Fire Weather website.",
                            },
                        ],
                        isError: true,
                    };
                }
    
                // Find station by name (case-insensitive partial match)
                const stations = Object.values(staData.stations) as any[];
                const station = stations.find((s: any) =>
                    s.station_name.toLowerCase().includes(town.toLowerCase())
                );
    
                if (!station) {
                    const availableStations = stations.map((s: any) => s.station_name).join(", ");
                    return {
                        content: [
                            {
                                type: "text",
                                text: `Could not find a weather station matching "${town}". Available stations: ${availableStations}. Please try one of these locations.`,
                            },
                        ],
                    };
                }
    
                // Navigate to specific station page
                const stationUrl = `${FIRE_DANGER_URL}?station=${station.source_id}`;
                await page.goto(stationUrl, { waitUntil: "networkidle0" });
    
                const currentStationData = await page.evaluate(() => {
                    // @ts-ignore
                    return typeof STA !== 'undefined' ? STA.currentStation : null;
                });
    
                if (!currentStationData || !currentStationData.firedanger) {
                    return {
                        content: [
                            {
                                type: "text",
                                text: `Could not retrieve fire danger data for ${station.station_name}.`,
                            },
                        ],
                        isError: true,
                    };
                }
    
                const fd = currentStationData.firedanger;
                const weather = currentStationData.weather;
    
                const output = {
                    stationName: station.station_name,
                    zoneId: station.zoneid.toString(),
                    burningIndex: fd.bi.toString(),
                    fireMoisture1hr: fd.fm1.toString(),
                    fireMoisture10hr: fd.fm10.toString(),
                    fireMoisture100hr: fd.fm100.toString(),
                    temperature: `${weather.dry_temp}°F`,
                    humidity: `${weather.rh}%`,
                    windSpeed: `${weather.wind_sp} mph`,
                    note: `Please verify the official Class Day (Low/Moderate/High) on the main map at ${FIRE_DANGER_URL} before burning.`,
                };
    
                return {
                    content: [
                        {
                            type: "text",
                            text: `Fire Weather Data for ${output.stationName} (Zone ${output.zoneId}):\n` +
                                `Burning Index: ${output.burningIndex}\n` +
                                `Fire Moisture (1-hr): ${output.fireMoisture1hr}\n` +
                                `Fire Moisture (10-hr): ${output.fireMoisture10hr}\n` +
                                `Fire Moisture (100-hr): ${output.fireMoisture100hr}\n` +
                                `Weather: ${output.temperature}, RH ${output.humidity}, Wind ${output.windSpeed}\n` +
                                `\nNote: ${output.note}`,
                        },
                    ],
                    structuredContent: output,
                };
    
            } catch (error: any) {
                return {
                    content: [
                        {
                            type: "text",
                            text: `Error checking fire danger: ${error.message}`,
                        },
                    ],
                    isError: true,
                };
            } finally {
                if (browser) {
                    await browser.close();
                }
            }
        });
    }
  • src/index.ts:14-14 (registration)
    Call to register the fire danger tool on the main MCP server instance.
    registerFireDangerTool(server);
Behavior3/5

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

With no annotations provided, the description carries the full burden. It mentions the purpose and outcome ('see if burning is allowed') but lacks details on behavioral traits such as data sources, update frequency, error handling, or authentication needs, which are important for a tool checking real-time danger ratings.

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 a single, well-structured sentence that efficiently conveys the tool's purpose, scope, and intended use without any redundant or unnecessary information, making it highly concise and front-loaded.

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?

Given the tool's low complexity (one parameter, no annotations, but with an output schema), the description is mostly complete. It covers the core purpose and usage intent, but could benefit from more behavioral context (e.g., data freshness, limitations) to fully compensate for the lack of annotations.

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?

The input schema has 100% description coverage, clearly documenting the 'town' parameter. The description adds minimal value beyond the schema by implying the town is in Maine, but it does not provide additional semantics like format examples or constraints, so the baseline score of 3 is appropriate.

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 clearly states the specific action ('Checks'), resource ('current fire danger rating'), and scope ('for a specific town in Maine'), distinguishing it from the sibling tool 'apply_for_burn_permit' which is about applying for permits rather than checking ratings.

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 implies usage context by specifying 'to see if burning is allowed,' which helps understand when to use this tool. However, it does not explicitly state when not to use it or mention alternatives like the sibling tool, leaving some guidance gaps.

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/stringtheoryaccelerator/publicmcp'

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