docs(stat): say which consumers actually see mime and frontmatter

Review feedback on #566: the module docstring told the agent it gets
"mime type and ... the parsed frontmatter alongside in metadata", which
reads as though an agent can use those fields to decide whether to
download or parse a file. It cannot: the MCP service returns only
`response.answer` (`mcp_tools.py` -> `return response.answer`), so
`metadata["mime"]` and `metadata["frontmatter"]` reach direct `Response`
consumers but never an MCP caller.

Spell the split out instead of implying one audience: the answer carries
path, type, size and mtime, and an agent that needs the frontmatter has
to read the file rather than stat it. The envelope description below is
unchanged, since it already lists the full metadata shape.
This commit is contained in:
Ziyang Guo 2026-09-29 20:50:44 +08:00
parent 0024d3a8de
commit 74c26656ea

View file

@ -1,9 +1,11 @@
"""``file_stat`` — peek at file metadata under the workspace without copying it.
Cheap inspection alternative to ``file_download``: the agent gets
size and mtime in the answer, with mime type and (for markdown files)
the parsed frontmatter alongside in metadata — enough to decide whether
to download / parse / skip without paying the copy cost.
Cheap inspection alternative to ``file_download``. The answer carries the
path, type, size and mtime, and the answer is all an MCP caller receives:
MCP returns only ``response.answer``. ``mime`` and, for markdown files,
the parsed frontmatter stay in ``metadata`` with the rest of the envelope,
so they reach direct ``Response`` consumers but never an MCP caller — an
agent that needs the frontmatter must read the file, not stat it.
Returns a uniform envelope: