Self-hostable Model Context Protocol (MCP) server wrapping Roshan AI's Fahm (فهم) Persian language service: chat over documents, translation, summarization, text generation, correction, classification and information extraction.
Server demonstrates solid tool design with 14 well-named, action-verb-prefixed tools (fahm_chat, fahm_translate, fahm_summarize, etc.). All tools have descriptions (avg ~150 chars, within 10-1024 baseline). Input schemas are present and typed for all tools. However, output schemas are not documented, LLMs cannot predict response structure. Parameter descriptions are present but often generic (e.g., 'Optional named instance to target'). No error handling guidance visible. Tool composition is clean (single responsibility), but some tools are ergonomic wrappers (fahm_translate wraps fahm_translate_text + fahm_translate_documents) which adds minor redundancy. Security is sound: no secrets in params, instance-based multi-tenancy via config. Naming is consistent and clear (verb_noun pattern throughout).
Chat with Fahm's LLM, optionally grounded on documents and media. Sends a ``query`` to Fahm's ``POST /api/chat/`` endpoint. The model can be grounded on Alefba ``document_urls`` and/or ``media_urls``, can carry conversation ``history``, can perform ``deep_research``, and can search a corpus via ``search_mode`` (e.g. ``"alefba"``). Streaming: when ``stream=True`` the API streams the answer incrementally; this tool does **not** stream tokens back over MCP — it issues the request in non-streaming mode by default and returns the complete answer. Leave ``stream`` at its default (``False``) for normal use; it is exposed only for API completeness.
Classify Alefba documents into one of a supplied set of labels (tags). Fahm (دستهبندی اطلاعات) receives a list of document URLs plus a set of candidate ``tags`` (each with a ``title`` and a ``description``) and returns, for each document and in the same order, the tag(s) it best matches.
Correct and edit a piece of text following a free-form instruction. Fahm (تصحیح و ویرایش متن) edits the supplied ``text`` according to ``description`` — for example "fix spelling and grammar" (اصلاح غلطهای املایی یا نگارشی).
Answer a list of questions against each of several Alefba documents. Fahm (استخراج اطلاعات) receives a list of document URLs plus a list of ``questions`` and tries to answer every question for each document. When it has no answer for a question it returns ``null`` for that slot. Answers are returned per document, in the same order as ``document_urls``.
Output schemas not documented. LLMs cannot predict response structure (fields, types, pagination). Affects all 14 tools.
No error handling guidance. Tools lack recovery hints (e.g., 'If auth fails, check credentials via healthcheck'). Agents cannot self-correct on failures.
Redundant tool pairs (fahm_translate + fahm_translate_text/documents, fahm_summarize + fahm_summarize_document). Adds cognitive load for LLM tool selection.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | D | 57 | <=2025-11-25 | v2 |
Generate Persian text (e.g. a letter) from a topic or instruction. Fahm (تولید متن) writes a full piece of text based on the short topic or instruction you provide — for instance ``"نامه درخواست مرخصی"`` (a leave request letter).
List Fahm chats, or fetch the history of one chat by ``id``. Calls Fahm's ``GET /api/chat/list/`` endpoint. Without ``id`` it returns the paginated list of chat/service history entries; with ``id`` it scopes the request to a single chat (its history). Each service entry carries ``{id, name, type, created_at, updated_at}``.
Summarize text or Alefba documents as prose (word) or a bullet list (bullet).
Ergonomic wrapper: summarize Alefba documents (word or bullet).
Ergonomic wrapper: translate text OR documents into Persian/English.
Translate one or more Alefba documents into Persian (fa) or English (en).
Translate text from any language into Persian (fa) or English (en).
Check connectivity and health of a configured Fahm instance. Calls Fahm's ``GET /api/healthcheck`` endpoint (authenticating first via ``POST /auth/glogin/`` with the instance's username/password, unless a static Bearer token is configured). A successful response means the base URL is reachable and the credentials are valid. The service returns ``{status, message, service, version}``, surfaced under ``response``.
List the configured Fahm instances (names and base URLs only). Secrets (tokens, usernames, passwords) are never returned — only the instance ``name``, its ``base_url``, and whether credentials are configured.
Return documentation about the Fahm service and this server's tools. Lets an agent discover capabilities, endpoints and the authentication model without leaving the MCP session. Links point at the official documentation at https://docs.roshan-ai.ir.
Parameter descriptions are generic ('Optional named instance to target'). Should explain when/why to use instance parameter and list available instances.
No pagination guidance. fahm_list_chats and fahm_extract_information may return large result sets; no limit/offset/cursor parameters visible.