Skip to content

docs(mcp): update get_observations and get_child_observations response schema to tabular format in researcher skills - #215

Merged
premr merged 4 commits into
mainfrom
fix/mcp-skill-response-schemas
Aug 25, 2026
Merged

docs(mcp): update get_observations and get_child_observations response schema to tabular format in researcher skills#215
premr merged 4 commits into
mainfrom
fix/mcp-skill-response-schemas

Conversation

@premr

@premr premr commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR updates the response schema documentation in the MCP skill playbooks:

  • data-commons-child-places-researcher/SKILL.md (Section 9)
  • data-commons-researcher/SKILL.md (Section 8)

Context & Problem

Currently, the researcher skills describe the response structure for get_observations and get_child_observations using a legacy placeObservations format:

{
  "variable": { "dcid": "...", "name": "..." },
  "placeObservations": [
    {
      "place": { "dcid": "...", "name": "...", "typeOf": [...] },
      "timeSeries": [{ "date": "2024", "value": 5.4 }]
    }
  ]
}

However, the live Agent API and MCP server return a compact, dual-table tabular format:

{
  "variable": { ... },
  "sourceMetadata": { ... },
  "alternativeSources": [],
  "entityMetadata": [
    ["geoId/06037", "Los Angeles County", ["County"]]
  ],
  "data": {
    "columns": ["observationAbout", "date", "value"],
    "rows": [
      ["geoId/06037", "2024", 5.4]
    ]
  }
}

This mismatch causes LLMs and autonomous agents following the skill instructions to write parsers targeting placeObservations and timeSeries, leading to unexpected parsing failures and 0 results errors.

Changes

  • Updated Section 8 of data-commons-researcher/SKILL.md to document the entityMetadata and data.columns / data.rows structure.
  • Updated Section 9 of data-commons-child-places-researcher/SKILL.md to document the same tabular dual-table structure.
  • Aligned both skill documents with data-commons-multi-entity-researcher/SKILL.md (which already references the dual-table format).

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the documentation in the SKILL.md files for both get_child_observations and get_observations responses to reflect a new uniform dual-table structure consisting of entityMetadata and a data table. The review feedback correctly identifies that the JSON examples in both files use sourceId (camelCase), whereas the underlying Pydantic model defines this field as source_id (snake_case) without an alias, and suggests updating the examples to ensure consistency with the actual API serialization.

…i/skills/data-commons-child-places-researcher/SKILL.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…i/skills/data-commons-researcher/SKILL.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

@premr premr left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing the MCP related skills so that the response example in skill://data-commons-child-places-researcher/SKILL.md to reflect data.rows and data.columns rather than placeObservations objects

@keyurva keyurva left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

"unit": "Percent"
},
"alternativeSources": [],
"entityMetadata": [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update entityMetadata so it is structured as an object with columns and rows to match the live API?

Testing against the live endpoint returns:

  "sourceMetadata": {
    "sourceId": "10031152674915191256",
    "measurementMethod": "BLSSeasonallyUnadjusted",
    "observationPeriod": "P1M",
    "provenanceUrl": "https://www.bls.gov/lau/"
  },
  "entityMetadata": {
    "columns": ["dcid", "name", "typeOf"],
    "rows": [
      ["geoId/06037", "Los Angeles County", ["AdministrativeArea2", "County", "Place"]],
      ["geoId/06075", "San Francisco County", ["AdministrativeArea2", "County", "Place"]]
    ]
  }

Notice also that sourceMetadata uses camelCase sourceId rather than source_id.

## 9. Processing `get_child_observations` Responses

All child observation responses return a uniform dual-table structure:
1. **`entityMetadata`**: Maps child entity DCIDs to human-readable names and types (e.g., `["geoId/06037", "Los Angeles County", ["County"]]`).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we clarify the subfield breakdown for entityMetadata similarly to data? For example:

* **`entityMetadata`**: Matrix of child entity metadata:
  * `columns`: Array of column names (`dcid`, `name`, `typeOf`).
  * `rows`: Tabular arrays of `[child_dcid, entity_name, entity_types]`.

@premr premr left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better? Fixed and added the enumeration in both places.

@premr
premr removed the request for review from rohitkumarbhagat August 25, 2026 15:51
@premr
premr enabled auto-merge (squash) August 25, 2026 15:55
@premr
premr merged commit 10fda34 into main Aug 25, 2026
13 of 14 checks passed
@premr
premr deleted the fix/mcp-skill-response-schemas branch August 25, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants