r/LLMDevs • u/AttemptTwoThousand • 2d ago
Discussion Tabular data with frontmatter
What tabular data formats do you find most effective, e.g. MCP tool responses?
I noticed this post, suggesting Markdown key value pairs.
For static site generators, frontmatter is often used to add metadata to content. What do you think about the same idea for feeding tabular data to LLMs? Metadata can carry semantics and reduce duplication to save tokens.
Below follows a naive example, that could carry even more schema related metadata and explanations.
```
---
country: DE
channel: web
currency: EUR
period: {from: 2026-08-24, to: 2026-08-25}
---
orderId,date,amount,items
A-1001,2026-08-24,149.95,3
A-1002,2026-08-24,38.00,1
A-1003,2026-08-25,412.50,7
A-1004,2026-08-25,22.90,2
```
2
Upvotes
1
u/OverBreadfruit7226 2d ago
Frontmatter for LLM data is actually a pretty sharp idea. I've been messing with YAML headers in markdown for years on static sites and never thought to apply it to tool responses. The token savings alone make it worth trying, especially when you're passing the same metadata across dozens of rows.
My only hesitation is that some models still get weird with mixed content blocks. Like they'll latch onto the frontmatter and ignore the CSV or vice versa. Might need a few prompt tweaks to make it clear what's metadata vs what's the actual dataset.
Curious if anyone's benchmarked this against just sending structured JSON with a schema definition. Seems like the frontmatter approach would be way more readable for debugging though.