Skip to main content
Glama
esty783

mcp-weather-israel-playwright

by esty783

MCP with Playwright - Weather (Israel)

This project is the MCP (Model Context Protocol) assignment from Malka Baruch's course: "MCP with Playwright".

Project purpose

The MCP server provides weather forecasts for Israeli cities using Playwright to drive a real browser and scrape data from https://www.weather2day.co.il/forecast. The goal is to enable an LLM (Claude) to control a browser through exposed Tools so it can retrieve live web data without a traditional API.

Related MCP server: MCP Playwright Weather Israel

What I implemented

Tools (MCP server - weather_Israel.py):

  1. open_weather_forecast_israel()

    • Opens a Chromium browser (headless=False) and navigates to the forecast site. Keeps the browser and Page instances in a global context to persist between Tool calls.

  2. enter_weather_search_israel(city: str)

    • Types the given city name into the site's search field and waits for the autocomplete list to appear.

  3. select_weather_forecast_city_israel()

    • Selects the first autocomplete result (or presses Enter) and waits for the forecast page to load.

  4. extract_weather_data_israel()

    • Extracts the visible forecast text from the loaded page and performs cleaning to remove advertisements and UI noise so the LLM receives only useful weather data.

How to run

  1. From the project-template folder:

cd C:\Users\user1\Downloads\dovrot-ai-projects-master\dovrot-ai-projects-master\8-mcp\project-template
uv sync
uv run playwright install chromium
  1. Start the host (terminal chat interface):

uv run host.py
  1. In the host chat prompt, ask a question such as:

  • "מה התחזית בתל אביב היום?"

  • "תן חיזוי גשם בתל אביב מחר"

The host should route the request to the weather-Israel MCP and the LLM will call the Tools in sequence (open → enter → select → extract) to fetch and return the forecast.

Submission instructions

  • Push the repository to GitHub as a public repo.

  • Include this README.md describing purpose and run instructions.

  • Make sure .env is not committed with real API keys. Use .env.example with placeholders.

Notes and troubleshooting

  • Ensure ANTHROPIC_API_KEY is set in your environment if running with the Anthropic SDK (Claude).

  • If Playwright selectors break (site changed), update the selectors in weather_Israel.py according to the site's HTML (inspect with DevTools).


This README follows the course submission guidelines: purpose, run steps, and example queries.

Available Tools

4 tools
enter_weather_search_israelA

Enter the city name into the search field and wait for autocomplete results.

This uses the shared Page in _PLAYWRIGHT_CONTEXT so open_weather_forecast_israel should be called first.

ParametersJSON Schema
NameRequiredDescriptionDefault
cityYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior4/5

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

Since no annotations are provided, the description carries the full burden. It discloses key behavioral traits: the tool interacts with a shared page context, waits for autocomplete results, and requires prior initialization. This is adequate, though it doesn't mention timeout behavior or error states.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loading the core action. The second sentence adds essential usage context. It is concise but could be more compact—e.g., combining the prerequisite note into the first sentence.

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 simple parameter set (1 required string), the existence of an output schema (likely for the autocomplete results), and sibling tools, the description covers the key interaction flow. It provides prerequisite guidance and action semantics. A mention of what happens after autocomplete (e.g., next tool to use) would increase completeness.

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?

Schema coverage is 0% (only one parameter with no description), so the description must compensate. The description explains what the 'city' parameter is used for: entering into a search field. This adds meaning beyond the bare schema property definition. A brief note on format or examples would improve it further.

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 clearly states the action (enter city name into search field) and the expected behavior (wait for autocomplete results). It is specific about the resource (search field) and the interaction type. However, it does not explicitly reference the tool name's 'weather search Israel' context, which is implied.

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

Usage Guidelines3/5

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

The description mentions that open_weather_forecast_israel should be called first, providing explicit prerequisite guidance. However, it does not address when to use this tool vs alternatives like select_weather_forecast_city_israel, or what to do if autocomplete fails.

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

extract_weather_data_israelA

Extract and clean the visible forecast text from the current page.

This expects that a forecast page is already loaded in the shared Page (i.e., after select_weather_forecast_city_israel). It will attempt to extract the main forecast container text and remove obvious noise like advertisements, links, and short UI strings.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior3/5

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

No annotations are provided, so the description must disclose behavioral traits. It states the tool will 'attempt' extraction (indicating potential failure) and remove 'obvious noise like advertisements, links, and short UI strings'. However, it does not specify what happens if no forecast is found or if extraction fails, leaving gaps in behavioral expectation.

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 two sentences—the first states the core purpose, the second adds essential context (precondition and noise removal). Every sentence earns its place; there is no redundancy or extraneous detail.

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?

Given the tool has no parameters and an output schema (from context signals), the description covers all needed context: what the tool does, expected preconditions, and what noise is cleaned. The presence of an output schema means return values need not be described. The description is complete for agent decision-making.

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 description coverage is 100% as there is nothing to document. The baseline per rubric is 4 for no parameters. The description adds no parameter info (unnecessary) and instead explains the tool's operation, which aligns with a score of 4.

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 verb 'extract' and resource 'visible forecast text from the current page'. It differentiates from sibling tools (which handle navigation and selection) by specifying that extraction occurs after the forecast page is loaded, establishing a unique role in the workflow.

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 explicitly states a precondition: the forecast page must already be loaded, specifically after calling 'select_weather_forecast_city_israel'. This provides clear context for when to use the tool. It does not list exclusions or alternative tools, but the sequential dependency is sufficient given the sibling context.

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

open_weather_forecast_israelA

Open the forecast site and keep the browser/page open for subsequent tools.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4/5.0
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses the key behavior (opens and keeps page open), but lacks details about side effects (e.g., navigation, loading state, error handling). Transparency is adequate but not deep.

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?

Description is a single concise sentence, front-loaded with the action. Every word earns its place; there is no wasted text. Excellent structure for quick agent comprehension.

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 tool is simple (no parameters, straightforward action). An output schema exists but is not mentioned; however, the rule says description needn't explain return values if output schema is present. The description could hint at what the tool returns (e.g., page handle), but it is complete enough for its role as an opener.

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%. Description adds no parameter info, but none is needed. For a parameterless tool, baseline is 4; the description simply confirms the tool's action, which is sufficient.

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?

Description states a specific verb ('Open') and resource ('forecast site for Israel'), clearly distinguishing it from sibling tools like enter_weather_search_israel or extract_weather_data_israel. The additional detail 'keep the browser/page open for subsequent tools' further clarifies its role as an initial setup action.

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

Usage Guidelines3/5

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

The phrase 'for subsequent tools' implies a sequencing hint, but the description does not explicitly state when to use this tool versus alternatives (e.g., 'Use first, before other weather tools'). There is no guidance on prerequisites or when not to use it.

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

Select the first autocomplete result (or press Enter) and wait for forecast page to load.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool waits for loading, but does not explain error states (e.g., no autocomplete, failed navigation) or whether the action is blocking. Partial disclosure.

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?

Single sentence, front-loaded with the verb 'Select', and includes an alternative action ('or press Enter'). No wasted words; concise and direct.

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 UI interaction with no parameters, the description covers the core behavior. It lacks details on return value (though output schema exists) and prerequisites, but is functionally complete for its scope.

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?

There are zero parameters, so the baseline is 4. The description adds no parameter-specific info, but none is needed. It does mention 'first autocomplete result,' which is a behavioral constant, not a parameter.

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 action: 'Select the first autocomplete result (or press Enter) and wait for forecast page to load.' This distinguishes it from sibling tools (open, enter, extract) by specifying the exact UI step.

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

Usage Guidelines3/5

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

The description implies the tool follows a search action (likely sibling enter_weather_search_israel), but it does not explicitly state when to use it versus alternatives or what conditions must be met (e.g., autocomplete must be visible). Usage context is vague.

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. 4 tool updatesv0.1.0
    • First observedenter_weather_search_israel
    • First observedextract_weather_data_israel
    • First observedopen_weather_forecast_israel
    • First observedselect_weather_forecast_city_israel

TDQS

A4.2/5.0
Disambiguation5/5

Each tool has a distinct step in a clear workflow: open site, search, select city, extract data. No overlapping responsibilities.

Naming Consistency5/5

All tools follow a consistent verb_weather_forecast_city_israel snake_case pattern, making the purpose of each clear.

Tool Count5/5

With 4 tools, the set is well-scoped for the specific task of fetching a weather forecast for an Israeli city. No unnecessary tools or omissions.

Completeness4/5

The tools cover the primary workflow, but lack error recovery or reset capabilities (e.g., no tool to handle failed city lookup or restart from scratch). Still sufficient for the intended use case.

Maintenance

ActivityInactive
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/esty783/mcp-weather-israel-playwright'

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