A Python client for PhysicsWallah PW platform providing access to batches, announcements, study materials, and performance tracking. Includes Streamlit dashboard UI and notification integrations.
This MCP server defines 26 tools for a PW (PhysicsWallah) learning platform client. The server has moderate structure but significant gaps in schema completeness and parameter validation. Most tools have basic descriptions but lack detailed parameter documentation. Input schemas are visible for most tools but lack proper type constraints (enums, min/max bounds). Error handling is present but not recovery-oriented. The codebase shows explicit tool registrations with schemas, but many parameter descriptions are generic or absent. No tool annotations (readOnlyHint, destructiveHint, idempotentHint) are present despite clear read vs. write distinctions. Overall, the server is functional but falls below the A/B threshold due to incomplete schemas, missing parameter constraints, and lack of error guidance for LLM recovery.
Fetches announcements for a specific batch. Returns a list of dicts with: announcement, _id, scheduleTime, attachment (name, baseUrl, key).
Fetch lecture statistics for a complete batch. Returns a dict with: completedChapter, completedLectures, totalWatchTime, totalChapters, totalLectures.
Fetch combined DPP-Quiz stats for a batch. Returns a list of dicts with: key, accuracy, marksObtained, correctQuestions, completedQuiz, totalQuiz.
Fetches all purchased batches for the authenticated user. Returns a list of dicts with: name, _id, slug, startDate, endDate, expiryDate.
Fetch DPP Notes (attachments) for a given topic in a subject of a batch. Returns a list of dicts with: topic (topic name) and attachments (list of dicts with _id, baseUrl, key, name).
Missing tool annotations for read vs. write operations. Tools lack readOnlyHint and destructiveHint metadata despite clear semantic differences (e.g., fetch_* vs send_*, save_known_ids). Agents cannot distinguish safe from unsafe operations without reading descriptions.
Incomplete parameter schemas. While most tools have type definitions, they lack constraint specifications (enums for quiz_type, min/max for page numbers, regex patterns for tokens). Parameters like 'page' accept integers with no bounds; an agent could pass page=999999, causing API errors or timeouts.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | D | 51 | 2026-07-28+ | v2 |
| 2026-03-09 | F | 0 | - | v1 |
Fetch questions for an attempted DPP-Quiz using its attempt ID. Returns list of dicts with: _id (question id), questionNumber, images (list of attachment dicts), options (list of { _id, en }), solution_option_ids (list), difficultyLevel, topicName, solutionDescriptions (list of image dicts). Only questions with solutions/options found.
Fetch notes (attachments) for a given topic in a subject of a batch. Returns a list of dicts with: topic (topic name) and attachments (list of dicts with _id, baseUrl, key, name).
Fetch lecture statistics for each subject in a batch. Returns a list of dicts with: subjectName, completedChapter, completedLectures, totalWatchTime, totalLectures, totalChapters.
Fetch DPP-Quiz stats for each subject in a batch. Returns a list of dicts with: subjectName, accuracy, marksObtained, totalQuestions, correctQuestions, attemptedQuestions, attempted, totalQuiz.
Fetches all subjects for a given batch. Returns list of subject dicts with: _id, subject, slug, teacherIds (list of dicts), tagCount, displayOrder, lectureCount.
Fetch topics/chapters for a subject in a batch. Returns list of topic dicts with: _id, name, displayOrder, notes, exercises, videos, lectureVideos, slug.
Formats the announcement for Telegram using Markdown. Shows PW Team as sender, notification time, and announcement text.
Fetch the attempt ID for a DPP-Quiz for a given topic, if it exists. Returns the attempt ID as a string, or None if unattempted.
Return only the announcements that are new (not in known_ids).
Returns a random integer in the Discord embed color range.
Exchanges phone and OTP for an access token. Returns a dict with access token or error info.
Calculates and returns token expiry information based on expiration timestamp.
Load known announcement IDs from a file.
Save known announcement IDs to a file.
Sends a single announcement to Discord via webhook, formatted with PW team profile and time at the top.
Sends multiple announcements one by one to Discord in chronological order (oldest first).
Sends OTP to the given phone number and country code. Returns a dict with success or error info.
Sends a single announcement to Telegram using sendPhoto (if image) or sendMessage.
Sends multiple announcements one by one to Telegram in chronological order (oldest first).
Update the set of known IDs with IDs from the latest fetch.
Verifies if an authentication token is valid and not expired.
Error handling lacks recovery guidance. Examples: 'Token verification failed' with no hint about calling send_otp/get_token; 'Failed to fetch announcements' with no suggestion to check batch_id validity. Errors are not categorized (retryable vs. user-fixable), leaving agents unable to plan recovery.
Credentials exposed in tool parameters. 'token', 'bot_token', 'webhook_url', and 'random_id' are passed as parameters. These will appear in agent logs, traces, and prompt history. Secrets should be injected server-side via environment variables or vault.
Output schemas not documented for most tools. Tool descriptions state what fields are returned (e.g., 'name, _id, slug...'), but no formal output schema is visible. LLMs cannot reliably parse responses or plan chained calls without documented output types.
Generic or trivial descriptions for utility tools. Examples: 'get_random_color' (40 chars: 'Returns a random integer in the Discord embed color range.'), 'get_token_expiry_info' (56 chars: 'Calculates and returns token expiry information...'). No context on WHEN to use these tools or what downstream operations need them.
Parameter descriptions missing or generic. Examples: 'page' in fetch_batches is described as 'Page number for pagination' but does not state default (1), min (1), or max bounds. 'batch_slug' is described as 'Batch slug identifier' without explaining how to obtain it or format constraints.
No batch variant for notification tools. Agents must call send_discord_announcement/send_telegram_announcement in a loop to send multiple announcements. Batch variants (send_discord_announcements, send_telegram_announcements) exist but are separate tools, adding cognitive load and increasing token waste.
Missing idempotency declarations. Tools like 'send_otp' and 'get_token' have side effects (sending SMSes, issuing tokens), but no idempotent/destructiveHint. If an agent retries due to a network error, it could send duplicate OTPs or create duplicate sessions.
Inconsistent pagination. Some tools have 'page' and 'limit' parameters (get_dpp_quiz_attempt_id), others only 'page' with hardcoded limits. No tool returns 'total_count' or 'next_cursor', making it hard for agents to know if more results exist or when to stop paginating.