Skip to main content
Glama
aseem-raspberry

shayari-mcp

Shayari: Devanagari-first shayari search MCP

A small, reproducible Python package for searching and reading Hindi/Devanagari shayari. The user-facing language is Hindi. Urdu is not required for search or reading, and this project does not transliterate or generate missing Hindi text.

Status

The first milestone uses the approved Kaggle source:

  • Urdu Ghazals Rekhta

  • Kaggle version 1, downloaded without credentials

  • 1,314 source stems, 30 poets

  • 1,306 Hindi files, of which one is empty

  • 1,305 source-valid Hindi-text records are active by explicit owner authorization. Nine source stems remain quarantined because they have no usable Hindi text.

The source metadata declares CC0, but the underlying Rekhta-derived rights are not independently verified. Read corpus/SOURCE.md before redistribution.

Related MCP server: video-evidence-mcp

Design decisions

  • text_devanagari is the canonical field and is required for active records.

  • No Urdu-to-Devanagari transliteration, translation, repair, or generation occurs.

  • Invalid or incomplete records are written to quarantine, never silently indexed.

  • title_devanagari and poet_devanagari remain optional because the inspected archive supplies only Roman source-path metadata.

  • title_source and poet_source preserve that metadata explicitly; it is searchable but is not mislabeled as Hindi.

  • Downloaded archives are ignored by Git. The generated active snapshot is versioned so a fresh checkout can search immediately; it contains no credentials.

Requirements

  • Python 3.9+

  • pytest for tests

  • Optional: the mcp Python package for the standard MCP server adapter

The core importer, validator, search service, and CLI use only the Python standard library.

Reproduce the corpus

From the project root, place the downloaded archive at .cache/urdu-ghazals-rekhta.zip, then run:

PYTHONPATH=src python3 scripts/import_kaggle.py .cache/urdu-ghazals-rekhta.zip

The command writes these files under corpus/generated/:

  • records.jsonl: active, owner-authorized source-valid records. Every record retains explicit provenance and authorization-status fields.

  • research.jsonl: empty under the default owner-authorized policy; available when using --activation-policy research_only for comparison.

  • quarantine.jsonl: rejected or incomplete source stems with reasons

  • audit.json: counts, source version, checksum, script distribution, and activation policy

To audit an existing generated directory:

PYTHONPATH=src python3 scripts/audit_corpus.py corpus/generated

CLI

Search the active, owner-authorized Hindi Devanagari corpus:

PYTHONPATH=src python3 -m shayari search 'दोस्ती' --limit 5
PYTHONPATH=src python3 -m shayari search 'मोहब्बत' --limit 5

The default importer policy is owner_authorized, which activates every source-valid Devanagari record while preserving the source's provenance and limitations. The activation is an owner decision, not a claim of independent legal or linguistic verification. To reproduce the earlier research-only layout explicitly:

PYTHONPATH=src python3 scripts/import_kaggle.py .cache/urdu-ghazals-rekhta.zip --activation-policy research_only

The current source has 1,305 active records after import. The remaining nine source stems stay quarantined because they have missing or empty Hindi text.

PYTHONPATH=src python3 -m shayari status

Set SHAYARI_CORPUS if the generated corpus lives outside corpus/generated:

SHAYARI_CORPUS=/path/to/generated shayari status

The explicitly named research-only MCP tool is available for inspection.

Search title and poet fields too, and inspect a result by ID:

PYTHONPATH=src python3 -m shayari show <record-id>
PYTHONPATH=src python3 -m shayari audit

All normal search results include the full text_devanagari field.

MCP server

The package exposes a stdio server through either the shayari-mcp command or the module entry point. With the optional mcp dependency installed:

python3 -m pip install 'mcp>=1.0,<2.0'
PYTHONPATH=src python3 -m shayari.mcp_server
# or, after installing this project:
shayari-mcp

The server tools are:

  • search_shayari

  • search_research_shayari (explicitly non-active research inspection)

  • get_shayari

  • audit_corpus

The handlers call the same lexical service as the CLI and return Hindi-facing fields by default. An in-process JSON-RPC-compatible fallback is included for local clients that do not have the optional SDK installed.

Example Hermes MCP configuration:

mcp_servers:
  shayari:
    command: python3
    args: ["-m", "shayari.mcp_server"]
    env:
      PYTHONPATH: "/absolute/path/to/Shayari/src"

Development

PYTHONPATH=src python3 -m pytest -q
ruff check src scripts tests
ruff format --check src scripts tests
mypy --python-version 3.9 src scripts
python3 -m build --wheel --sdist

The downloaded .cache/ archive is ignored. The versioned corpus/generated/ snapshot can be regenerated from it. Do not add credentials, tokens, or environment files to the repository.

Available Tools

4 tools
audit_corpusA

Return verified corpus counts and provenance metadata.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.5/5.0
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It only mentions that the tool 'returns' data, implying a read operation, but does not explicitly state side effects, permission requirements, rate limits, or whether it is safe. The term 'verified' hints at some internal process but offers no details. For a tool with zero annotations, this is a significant gap.

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, front-loaded sentence with no filler. It conveys the primary action and the output in a compact form. Every word contributes to meaning, making it appropriately concise and well-structured for a simple tool.

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 tool with no parameters and no output schema, the description should explain what the return values represent. It says 'corpus counts and provenance metadata' but does not elaborate on what counts are included (e.g., total shayari count, language breakdowns) or what 'provenance' means. While the tool is simple, an agent might need more detail to interpret the output correctly. Given the lack of an output schema, the description is minimally adequate but leaves room for ambiguity.

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 0 parameters, so the baseline is 4 as per the rules. The schema is empty, and the description does not need to explain parameters since none exist. The description adds no parameter-related information, but that is acceptable given the absence of 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?

The description states a clear action ('return') and a specific resource ('verified corpus counts and provenance metadata'). It clearly distinguishes itself from sibling tools (search_shayari, search_research_shayari, get_shayari) which focus on retrieving shayari content, whereas this tool provides audit statistics. The verb and resource are specific enough for an agent to understand its unique purpose.

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?

The description provides no guidance on when to use this tool versus alternatives. It does not mention that it is for overall corpus statistics, nor does it exclude usage for searching or retrieving individual shayari. An agent has no context about prerequisites or scenarios where this tool is preferred over the siblings.

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

get_shayariA

Get one active Hindi-facing shayari record by stable ID.

ParametersJSON Schema
NameRequiredDescriptionDefault
idYes

TDQS

A3.5/5.0
Behavior2/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 of behavioral disclosure. It does disclose filtering semantics ('active', 'Hindi-facing') but says nothing about error behavior — what happens when the ID doesn't exist or the record is inactive — nor the response shape. For a single-record fetch with zero annotation coverage, this is a meaningful gap.

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?

A single, front-loaded sentence with zero filler. The core action and the key constraints ('active', 'Hindi-facing', 'by stable ID') all appear before any qualification, and every word earns its place.

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 get-by-id tool with one parameter and no output schema, the description covers the purpose, the parameter's meaning, and the selection constraint. It omits error/not-found behavior and return format, but given the low complexity these are minor gaps rather than blocking omissions.

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?

Schema description coverage is 0%, so the description must compensate. It adds the useful semantic that the ID is 'stable' (a persistent identifier), which clarifies the parameter's nature, but it gives no format, origin, or example of a valid ID. The value added over the bare minLength:1 schema is minimal.

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 uses a specific verb ('Get'), a specific resource ('shayari record'), and adds distinguishing constraints ('active', 'Hindi-facing', 'by stable ID'). This clearly differentiates it from the search siblings — an agent can tell get_shayari (fetch by ID) apart from search_shayari (query by criteria) without opening schemas.

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 is for fetching a specific known record by ID, which suggests when it should be used over the search tools, but it never explicitly names the alternatives or states the condition for choosing one over the other. The contrast with search_shayari is implicit, not stated.

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

search_research_shayariB

Search source-valid but non-active research records.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
queryYes

TDQS

B3.2/5.0
Behavior2/5

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

With no annotations provided, the description must carry the full burden of behavioral disclosure. It only says 'search' which implies a read-only operation, but it doesn't disclose whether the search has any side effects, requires specific permissions, or has rate limits. It also doesn't explain what 'non-active' means in concrete terms or what kind of results are returned (e.g., does it return full records or just metadata?).

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, concise sentence with no wasted words. It front-loads the purpose with the verb 'search' and resource, and includes the key qualifier 'source-valid but non-active' to clarify scope.

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

Completeness2/5

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

Given that there is no output schema, no parameter description coverage, and no annotations, the description needs to provide more context to be complete. It doesn't explain the meaning of 'source-valid' and 'non-active', which are crucial for an agent to determine whether this tool is appropriate. It also doesn't specify the return format or any limitations beyond the implicit 'search'. With two parameters and no schema coverage, the description is insufficient for reliable invocation.

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?

Schema description coverage is 0%, so the schema provides no semantic meaning for the parameters. The description mentions 'query' contextually but doesn't explicitly describe either 'query' or 'limit' meaning. 'limit' is self-explanatory from the schema (max 100), but 'query' could benefit from clarification (e.g., what fields are searched). Since the schema lacks descriptions, the description should compensate but it doesn't provide any parameter-specific guidance.

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 states a specific verb ('search') and a specific resource ('source-valid but non-active research records'). It clearly distinguishes from 'search_shayari' by specifying the subset (non-active research records). However, it doesn't explicitly name the sibling alternative, which would have made it a 5.

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 when to use this tool (when searching for non-active research records) and indirectly suggests that 'search_shayari' is for active ones, but it doesn't explicitly state when NOT to use it or mention alternative tools. The guidance is clear enough for the primary use case but lacks explicit exclusions.

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

search_shayariB

Search active, owner-authorized Hindi Devanagari shayari text.

ParametersJSON Schema
NameRequiredDescriptionDefault
poetNo
limitNo
queryYesHindi/Devanagari query

TDQS

B3/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 of disclosing behavior. It mentions 'active' and 'owner-authorized' constraints, which is useful context for a search operation. However, it does not disclose return format, pagination, authentication needs, or what happens when no results exist. It is adequate but not rich.

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?

A single, front-loaded sentence with no wasted words. It states the purpose and key constraints efficiently. This is an example of good conciseness.

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

Completeness2/5

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

For a tool with 3 parameters, no output schema, and no annotations, the description is insufficient. It does not differentiate from search_research_shayari, does not explain optional parameters, and does not describe the result format. An agent would struggle to use it correctly without additional context.

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?

Schema description coverage is only 33% (only 'query' has a description). The tool description does not explain the 'poet' or 'limit' parameters, nor does it clarify the expected format of the query beyond what the schema says. Given the low coverage, the description should compensate but does not.

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 a specific action (search) and resource (Hindi Devanagari shayari text) with qualifiers 'active' and 'owner-authorized'. It distinguishes from siblings by implying filtering but does not explicitly name alternatives. It is not a tautology and provides a clear purpose.

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?

The description gives no guidance on when to use this tool versus search_research_shayari or get_shayari. It implies a scope (active, owner-authorized content) but does not state conditions or alternatives. An agent would have to infer when to choose this over siblings.

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.

  1. 4 tool updatesv0.1.0
    • First observedaudit_corpus
    • First observedget_shayari
    • First observedsearch_research_shayari
    • First observedsearch_shayari

TDQS

A3.7/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a distinctly scoped purpose: search active shayari, search research records, retrieve an active shayari by ID, and audit corpus metadata. No overlapping or ambiguous boundaries between tools.

Naming Consistency5/5

All tools follow a consistent verb_noun snake_case pattern: search_shayari, search_research_shayari, get_shayari, audit_corpus. The naming uniformly uses clear verbs and nouns with no mixed conventions.

Tool Count5/5

Four tools is well-scoped for a shayari corpus server, covering search (active and research), retrieval by ID, and audit. Each tool earns its place without redundancy or bloat.

Completeness4/5

The surface covers core search and retrieval for active shayari, plus audit metadata. However, there is no get_research_shayari by ID, meaning research records cannot be individually retrieved, leaving a minor gap for that workflow.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers