agentleFS
Galbaz1Galbaz1/video-research-mcp/src/AGENTS.md

video-research-mcp / src

AGENTS.md23 starsChanged 38 days agoMITView on GitHub

Applies to source files under src/. - Tools are async functions and should stay directly callable. - Do not add FastMCP 2.x compatibility code. - Generative tools return dict values; serialize Pydantic models using model_dump(). - Native media tools may return mcp.types.CallToolResult with typed structuredContent, a JSON text block, and bounded ImageContent. Declare an explicit success/error output schema and offer the same metadata without images. Existing tools keep their published return contracts. - Never let tool exceptions escape; return make_tool_error()…

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

14 rules. About 0 are common, 1 is distinctive, and 13 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 13

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use one FastMCP instance per sub-server, mounted on the root app.

    line 7
  2. Very specific:

    Import ToolAnnotations from mcp.types (not from fastmcp).

    line 9
  3. Very specific:

    Use lifespan via @asynccontextmanager when needed.

    line 10
  4. Distinctive:

    Do not add FastMCP 2.x compatibility code.

    line 15
  5. Very specific:

    Never let tool exceptions escape.

    line 21
  6. Very specific:

    All tools must have @trace(name="tool_name", span_type="TOOL") decorator — no-op when mlflow not installed.

    line 22
  7. Very specific:

    Use Annotated[type, Field(description="...")] for parameters.

    line 26
  8. Very specific:

    Use ThinkingLevel alias for thinking depth fields.

    line 27
  9. Very specific:

    Prefer optional params with defaults over required params set to None.

    line 28
  10. Very specific:

    Use the singleton GeminiClient.get().

    line 32
  11. Very specific:

    Use async generation via client.aio.models.generate_content().

    line 37
  12. Very specific:

    Import SDK types from google.genai import types.

    line 38
  13. Very specific:

    Keep defensive attribute checks such as getattr(..., "thought", False) and grounding metadata checks.

    line 48
  14. Very specific:

    Use cached content in GenerateContentConfig.

    line 49

≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md (src scope)

Applies to source files under src/.

FastMCP Patterns (v4.x)

  • Use one FastMCP instance per sub-server, mounted on the root app.
  • Register tools with @server.tool(annotations=ToolAnnotations(...)).
  • Import ToolAnnotations from mcp.types (not from fastmcp).
  • Use lifespan via @asynccontextmanager when needed.

Tool Function Rules

  • Tools are async functions and should stay directly callable.
  • Do not add FastMCP 2.x compatibility code.
  • Generative tools return dict values; serialize Pydantic models using model_dump().
  • Native media tools may return mcp.types.CallToolResult with typed structuredContent, a JSON text block, and bounded ImageContent. Declare an explicit success/error output schema and offer the same metadata without images. Existing tools keep their published return contracts.
  • Never let tool exceptions escape; return make_tool_error() instead.
  • All tools must have @trace(name="tool_name", span_type="TOOL") decorator — no-op when mlflow not installed.

Parameter Rules

  • Use Annotated[type, Field(description="...")] for parameters.
  • Use ThinkingLevel alias for thinking depth fields.
  • Prefer optional params with defaults over required params set to None.

Google GenAI SDK Patterns

  • Use the singleton GeminiClient.get(); do not instantiate genai.Client() directly.
  • Route generation through GeminiClient.generate(), .generate_structured(), or .generate_json_validated().
  • Deterministic local operations validate typed inputs/results directly and do not invoke Gemini. Optional external MCPs run separately and use their own schemas; they must not add provider/runtime requirements to core startup.
  • Use async generation via client.aio.models.generate_content().
  • Import SDK types from google.genai import types.

Key usage:

  • types.Part, types.Content, types.GenerateContentConfig, types.ThinkingConfig
  • Video parts via types.Part.from_uri(file_uri=..., mime_type=...)

Thinking and Caching

  • Include ThinkingConfig(thinking_level=...) through project config.
  • The default model supports low, medium, high; reject unsupported minimal with an actionable validation error.
  • Keep defensive attribute checks such as getattr(..., "thought", False) and grounding metadata checks.
  • Use cached content in GenerateContentConfig; prewarm and lookup through context cache helpers.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.