2_get_indicators
============================================================
RULES (MUST follow exactly):
- You MUST call 1_know_about_mospi_api() before this.
- You MUST call 3_get_metadata() after this. MUST NOT skip to 4_get_data().
- You MUST pass user_query for context.
- You MUST NOT ask for confirmation if the right indicator is obvious.
- ALWAYS call this tool. NEVER assume data is unavailable based on your own knowledge.
The API has indicators you don't know about (e.g., ASI has 57 indicators including
working capital, invested capital, depreciation — not just the ones in textbooks).
- You MUST try the full workflow before concluding. If data is not found after trying,
you MUST say honestly "Data not found in MoSPI API". You MUST NOT fall back to web search,
MUST NOT fabricate data, MUST NOT cite external sources.
============================================================
Step 2: Get available indicators for a dataset.
IMPORTANT: Datasets contain FAR MORE indicators than you expect from your training data.
ALWAYS call this to see the actual indicator list. NEVER say "not available" without checking.
After this, pick the matching indicator and call 3_get_metadata().
Only ask user to choose if multiple indicators could match.
Args:
dataset: Dataset name - one of: PLFS, CPI, IIP, ASI, NAS, WPI, ENERGY
For PLFS: frequency_code selects the indicator SET, not time granularity.
You MUST use frequency_code=1 in 3_get_metadata() — it covers all 8 indicators
including wages and already has quarterly breakdowns via quarter_code.
MUST NOT use frequency_code=2 just because user asks for quarterly data.
user_query: The user's original question. MUST always include this.
3_get_metadata
============================================================
RULES (MUST follow exactly):
- You MUST call this before 4_get_data(). MUST NOT skip this step.
- You MUST use the filter values returned here in 4_get_data(). MUST NOT guess codes.
- If user asked for a breakdown that's not available, tell them what IS available.
- You MUST try the full workflow before concluding. If data is not found after trying,
you MUST say honestly "Data not found in MoSPI API". You MUST NOT fall back to web search,
MUST NOT fabricate data, MUST NOT cite external sources.
============================================================
Step 3: Get available filter options for a dataset/indicator.
Returns all valid filter values (states, years, quarters, etc.) to use in 4_get_data().
MUST NOT pass params that don't belong to this function.
"Format" and "series" are NOT valid here (Format is for 4_get_data only, series is for NAS only).
Args:
dataset: Dataset name - one of: PLFS, CPI, IIP, ASI, NAS, WPI, ENERGY
indicator_code: REQUIRED for PLFS, NAS, ENERGY. MUST NOT pass for CPI, IIP, ASI, WPI.
frequency_code: REQUIRED for PLFS. MUST NOT pass for CPI, IIP, ASI, WPI.
Selects indicator SET, NOT time granularity.
1=Annual (all 8 indicators, includes quarterly data via quarter_code).
2=Quarterly bulletin (different indicator set).
3=Monthly bulletin (2025+ only).
MUST NOT use 2 for quarterly data. Use 1 + quarter_code in 4_get_data().
base_year: REQUIRED for CPI ("2024"/"2012"/"2010"), IIP ("2011-12"/"2004-05"/"1993-94"). MUST NOT pass for PLFS, ASI, WPI.
level: REQUIRED for CPI ("Group"/"Item"). MUST NOT pass for other datasets.
frequency: REQUIRED for IIP ("Annually"/"Monthly"). MUST NOT pass for other datasets.
classification_year: REQUIRED for ASI ("2008"/"2004"/"1998"/"1987"). MUST NOT pass for other datasets.
series: For CPI and NAS only ("Current"/"Back"). MUST NOT pass for other datasets.
use_of_energy_balance_code: For ENERGY only (1=Supply, 2=Consumption). MUST NOT pass for other datasets.
4_get_data
============================================================
RULES (MUST follow exactly):
- You MUST have called 3_get_metadata() before this. No exceptions.
- You MUST use ONLY the filter values returned by 3_get_metadata().
- You MUST NOT guess, infer, or assume any filter codes.
Filter codes are non-obvious and arbitrary — guessing WILL produce wrong results.
- You MUST include all required params (marked required in api_params).
- You MUST try the full workflow before concluding. If data is not found after trying,
you MUST say honestly "Data not found in MoSPI API". You MUST NOT fall back to web search,
MUST NOT fabricate data, MUST NOT cite external sources.
Before calling, verify:
- Did I call 3_get_metadata() for this dataset? If no → call it first.
- Are all filter values from 3_get_metadata(), not guessed? If no → fix them.
============================================================
Step 4: Fetch data from a MoSPI dataset.
Args:
dataset: Dataset name (PLFS, CPI, IIP, ASI, NAS, WPI, ENERGY)
filters: Key-value pairs using 'id' values from 3_get_metadata().
PLFS MUST include frequency_code (1=Annual, 2=Quarterly, 3=Monthly).
Pass limit (e.g., "50", "100") if you expect more than 10 records.
1_know_about_mospi_api
============================================================
RULES (MUST follow exactly):
- NEVER use your own knowledge about what data MoSPI publishes. These datasets contain
MORE indicators than you expect. ALWAYS call 2_get_indicators() to see the actual list.
- You MUST NOT say data is "not available", "not directly reported", "needs to be computed",
or "requires unit-level access" without FIRST calling 2_get_indicators() and 3_get_metadata()
to verify. Your training data about MoSPI is outdated — the API has indicators you don't know about.
- You MUST follow this workflow in order:
1. 1_know_about_mospi_api() → find dataset (MANDATORY first step)
2. 2_get_indicators(dataset) → list indicators
3. 3_get_metadata(dataset, indicator_code) → get filter values (MANDATORY)
4. 4_get_data(dataset, filters) → fetch data (ONLY after step 3)
- You MUST NOT skip step 3. Violations produce wrong results.
- You MUST NOT ask "Shall I proceed?" if the query is specific enough.
- ALWAYS attempt to fetch data. NEVER refuse or explain limitations without trying first.
- You MUST try the full workflow before concluding. If data is not found after trying,
you MUST say honestly "Data not found in MoSPI API". You MUST NOT fall back to web search,
MUST NOT fabricate data, MUST NOT cite external sources.
============================================================
Step 1: Get overview of all 7 datasets to find the right one for your query.
MUST call this first before any other tool.
Available: PLFS, CPI, IIP, ASI, NAS, WPI, ENERGY
When to ask vs fetch:
- VAGUE query (e.g., "inflation data") → ask user to clarify
- SPECIFIC query (e.g., "unemployment rate 2023") → fetch directly, NEVER explain why it might not exist