Skip to main content
Glama

⛅ Weather MCP with Playwright

שרת MCP עצמאי ששולף תחזית מזג אוויר ישראלית על ידי הפעלת דפדפן אמיתי עם Playwright — במקום קריאה ל‑API. ה‑Host מחבר את הכלים למודל Google Gemini, כך שה‑LLM עונה על שאלת המשתמש ישירות בצ׳אט (מעין RAG מעל תוכן הדף).

צילום מסך של ממשק הצ׳אט

איך זה עובד

  1. המשתמש שואל שאלה בצ׳אט (Gradio).

  2. Gemini מחליט להפעיל את הכלי get_israel_forecast.

  3. הכלי מריץ דפדפן Chrome אמיתי: נכנס לאתר התחזית → מקליד את שם העיר → בוחר עיר מהרשימה → מחלץ ומנקה את טקסט הדף.

  4. הטקסט הנקי חוזר ל‑Gemini, שמנסח תשובה קצרה בשפת המשתמש.

Related MCP server: Weather Israel MCP Server

מבנה הפרויקט

קובץ

תפקיד

weather_Israel.py

שרת MCP — כלי Playwright לאתר התחזית הישראלי

weather_USA.py

שרת MCP — תחזית ארה״ב דרך ה‑API של NWS

client.py

MCPClient — התחברות לשרת MCP דרך stdio

host.py

ChatHost — גשר בין כלי MCP למודל Gemini (לולאת tool‑calling)

app.py

ממשק צ׳אט ב‑Gradio

הכלים

שרת weather-Israel — כל הכלים מוגדרים עם @mcp.tool() ומחוברים ל‑Host:

שלב א׳

  • open_weather_forecast_israel — פתיחת אתר התחזית

  • enter_weather_forecast_city_israel(city) — הזנת שם עיר

  • select_weather_forecast_city_israel — בחירת העיר מרשימת ההשלמה

שלב ב׳

  • get_weather_page_content_israel — חילוץ וניקוי טקסט הדף כדי שה‑LLM יענה מהנתונים

נוחות

  • get_israel_forecast(city) — מריץ את כל הרצף בקריאה אחת (כדי לחסוך בבקשות ל‑Gemini)

הרצה

דרישות: Python 3.13+, uv, ו‑Google Chrome מותקן.

uv sync

צרו קובץ .env:

GEMINI_API_KEY=...        # מפתח חינם: https://aistudio.google.com/apikey
# WEATHER_HEADLESS=1      # אופציונלי — הרצת הדפדפן ללא חלון גלוי

ממשק גרפי:

uv run python app.py     # פותח http://127.0.0.1:7860

טרמינל:

uv run python host.py

הערות

  • מכסת Gemini החינמית מוגבלת במספר בקשות ליום לכל מודל. אם היא נגמרת — היא מתאפסת אוטומטית תוך 24 שעות, או שאפשר לשנות את MODEL ב‑host.py.

  • הקוד מגדיר verify=False בבקשות ה‑HTTPS כדי לעבור דרך פרוקסי TLS מקומי (כגון NetFree).

  • .env ו‑.venv/ לא נכללים ב‑git — כל מי שמריץ צריך .env משלו.

Available Tools

5 tools
enter_weather_forecast_city_israelA

Types the specific city name into the search bar. Requires 'city' argument. Must be called right after opening the browser.

ParametersJSON Schema
NameRequiredDescriptionDefault
cityYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the burden, and it does disclose the core UI action (typing into the search bar) and the temporal constraint. It does not mention whether the text is submitted or whether the search bar is cleared first, but the verb 'types' is specific enough to convey the immediate behavior.

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 short sentences with no filler; the action is front-loaded and every clause ('requires city,' 'right after opening browser') adds operational value.

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 one-parameter UI input step, the description gives the core action, the required argument, and the timing. It is enough to call correctly, though it could name the natural next step (select_weather_forecast_city_israel) for stronger workflow support.

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?

The schema has zero description coverage, so the description must compensate. It only repeats the requirement for 'city' and adds the vague qualifier 'specific city name,' without specifying acceptable formats, languages, or whether the value must match a known list.

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 concrete action ('Types the specific city name into the search bar'), names the target resource ('search bar'), and requires a city input. This clearly distinguishes it from sibling tools like open_weather_forecast_israel and get_israel_forecast.

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?

It provides explicit sequencing ('Must be called right after opening the browser') but does not name alternatives or explain how it differs from select_weather_forecast_city_israel, so it lacks exclusions.

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

get_israel_forecastA

One call that does the whole flow: open the forecast site, search for 'city', pick the first match, and return the cleaned forecast text. Use this for a normal weather question - it keeps the conversation short. The separate open/enter/select tools are for stepping through the browser manually.

ParametersJSON Schema
NameRequiredDescriptionDefault
cityYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.4/5.0
Behavior4/5

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

The description outlines the internal steps (open, search, pick first, return) and implies a read-only operation, but it does not explicitly state it is non-destructive or mention any side effects. Since annotations are absent, the description carries the burden; however, no hidden actions are indicated, so it is reasonably transparent.

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 concise and well-structured. It states the purpose, provides usage guidance, and contrasts with alternatives in just three sentences, with 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?

The description covers the key behavior (including the 'pick the first match' detail) and when to use it, but does not mention output format details, error handling, or edge cases. For a simple one-parameter tool, it is largely complete, though a bit more context on output would elevate it.

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 only parameter 'city' is mentioned in the description ('search for 'city'') but lacks detailed semantics such as expected format, examples, or case sensitivity. The schema provides no description either, so the parameter meaning is only partially clarified. With one parameter, this is adequate but not thorough.

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 tool's purpose: it performs a complete weather forecast retrieval flow (open site, search, select first match, return cleaned text). It distinguishes itself from the step-by-step sibling tools, making its purpose unambiguous.

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?

Explicit guidance is provided on when to use this tool ('for a normal weather question') and when to use the alternatives (for manual step-by-step browsing). This meets the 'explicit when/when-not' criterion perfectly.

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

get_weather_page_content_israelA

Extracts and returns the visible text content of the currently open weather page. Call this after navigating to a city forecast to give the LLM the actual weather data.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden, and it does well: it discloses that the tool reads only visible text, depends on a currently open page, and should be invoked after navigation. It could add failure behavior for when no page is open, but the core stateful dependency is explicitly stated.

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 carry exactly the needed information: the first defines the operation, the second defines the invocation context. No filler or redundancy.

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?

For a zero-parameter, read-only extraction tool with an output schema, the description is complete. It states the precondition ('after navigating') and the content scope ('visible text'), so an agent knows when and how to use it.

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?

The tool has zero parameters, so schema coverage is trivially 100% and the baseline is 4. No parameter documentation is needed, and the description appropriately focuses on the output content rather than inputs.

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 names a specific action ('Extracts and returns') and a concrete resource ('visible text content of the currently open weather page'). It also distinguishes this tool from siblings by emphasizing that it reads the visible page content after navigation, rather than fetching forecast data directly.

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 clear timing context: 'Call this after navigating to a city forecast.' It does not explicitly list alternative tools or state when not to use it, so it misses the full when/when-not guidance, but the intended workflow is clear.

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

open_weather_forecast_israelB

Open Chrome and navigate to the Israel weather forecast page.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the burden and does disclose the key side effect: launching Chrome and navigating to a page. However, it does not mention whether it waits for load, returns content, or handles failures, which limits transparency.

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, efficient sentence with the core action front-loaded. It contains no filler, repetition, or unnecessary detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple zero-parameter browser-navigation tool, the description is minimally adequate. However, it omits any mention of return behavior and does not position the tool against its four overlapping siblings, leaving some contextual gaps.

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?

The tool has zero parameters and schema coverage is 100%, so there are no parameter semantics for the description to clarify. Per the rubric, a zero-parameter tool gets a baseline of 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb and resource: 'Open Chrome and navigate to the Israel weather forecast page.' It clearly names the Chrome navigation action, which distinguishes it from data-fetching siblings like get_israel_forecast, though it does not explicitly differentiate them.

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

Usage Guidelines2/5

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

No guidance is given on when to choose this tool over the related siblings, no prerequisites are mentioned, and no exclusions are stated. The single sentence describes only the action, leaving all usage context to inference.

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

select_weather_forecast_city_israelA

Clicks the first suggestion in the search dropdown menu. Call this ONLY after enter_weather_forecast_city_israel has finished executing. Takes no arguments.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.5/5.0
Behavior3/5

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

No annotations are present, and the description only mentions the click action without detailing any potential side effects, navigation changes, or loading states. While the action is simple, more behavioral context (e.g., what happens after the click) could improve transparency.

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 concise—two sentences that fully convey the action and the precondition. No unnecessary details or redundancy.

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?

For a simple, parameterless click action, the description provides sufficient context: what it does, when to call it, and that it has no arguments. No further information is needed for correct invocation.

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?

The tool takes no parameters, so parameter semantics are not applicable. The description correctly states 'takes no arguments,' aligning with the schema. Baseline score of 4 is appropriate given zero parameters.

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 (clicks the first suggestion in the search dropdown) and its role as a follow-up to entering a city. Distinguishes it from sibling tools by specifying the exact UI interaction.

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?

Explicitly instructs that this tool should only be called after enter_weather_forecast_city_israel has finished, providing unambiguous usage context. This is strong guidance for when to invoke the tool.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 5 tool updatesv0.1.0
    • First observedenter_weather_forecast_city_israel
    • First observedget_israel_forecast
    • First observedget_weather_page_content_israel
    • First observedopen_weather_forecast_israel
    • First observedselect_weather_forecast_city_israel

TDQS

A4.1/5.0
Disambiguation4/5

The high-level get_israel_forecast tool is clearly distinct from the manual browser steps, and its description explicitly directs agents to use it for normal queries. The four step-by-step tools are sequential and have clear dependencies, so an agent can distinguish them. However, both paths ultimately return weather data, creating slight overlap in purpose.

Naming Consistency4/5

All tools end with '_israel' and use clear verbs (get, open, enter, select, get). The pattern is mostly verb + object + israel, though get_israel_forecast breaks the order (get + israel + forecast) and some names are verbose. Overall, the naming is readable and predictable, with only minor deviations.

Tool Count5/5

With 5 tools, the server is well-scoped. The high-level tool provides a quick path, while the four low-level tools enable manual browser control. This is a reasonable size that avoids redundancy and keeps the surface manageable.

Completeness5/5

The tool set covers the full weather retrieval workflow: the high-level tool handles everything in one call, and the manual tools cover open, search, select, and read steps. There are no missing operations for the stated purpose of fetching Israel weather forecasts, and the domain is read-only, so no CRUD gaps exist.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

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/Ayala679/Weather--MCP'

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