Skip to main content
Glama

faf_agents

Export agent documentation from .faf files to create universal context files compatible with OpenAI Codex, Cursor, and other AI development tools.

Instructions

Export AGENTS.md content from a .faf file. Generates a universal agent context file compatible with OpenAI Codex, Cursor, and other AI tools. Write the output to AGENTS.md in the project root.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoproject.faf

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main faf_agents tool handler function. Exports AGENTS.md content from a .faf file. Takes a path parameter (default 'project.faf'), parses and validates the file, then generates markdown content with project info, context, and stack. Returns a dict with success status, content, or error message.
    @mcp.tool()
    def faf_agents(path: str = "project.faf") -> dict:
        """Export AGENTS.md content from a .faf file.
        Generates a universal agent context file compatible with OpenAI Codex, Cursor, and other AI tools.
        Write the output to AGENTS.md in the project root."""
        try:
            faf = parse_file(path)
            data = faf.data
            result = validate(faf)
    
            md = f"""# AGENTS.md — {data.project.name}
    
    ## Project
    - **Name:** {data.project.name}
    - **Goal:** {data.project.goal or 'Not specified'}
    - **Language:** {data.project.main_language or 'Not specified'}
    - **FAF Score:** {result.score}%
    
    ## Instructions for AI Agents
    - This project uses FAF (Foundational AI-context Format)
    - Read project.faf for complete project DNA
    - Media Type: application/vnd.faf+yaml (IANA registered)
    """
    
            if data.human_context:
                md += f"""
    ## Context
    - **Who:** {data.human_context.who or 'Not specified'}
    - **What:** {data.human_context.what or 'Not specified'}
    - **Why:** {data.human_context.why or 'Not specified'}
    """
    
            if data.stack:
                md += f"""
    ## Stack
    - **Frontend:** {data.stack.frontend or 'N/A'}
    - **Backend:** {data.stack.backend or 'N/A'}
    - **Database:** {data.stack.database or 'N/A'}
    - **Testing:** {data.stack.testing or 'N/A'}
    """
            return {"success": True, "content": md}
        except FileNotFoundError:
            return {"success": False, "error": f"File not found: {path}"}
        except FafParseError as e:
            return {"success": False, "error": str(e)}
  • server.py:270-270 (registration)
    Tool registration via @mcp.tool() decorator. This registers the faf_agents function as an MCP tool with FastMCP, making it discoverable and callable by MCP clients.
    @mcp.tool()
  • server.py:20-24 (registration)
    FastMCP server instance creation. Creates the 'mcp' object with name 'gemini-faf-mcp', version, and instructions. The @mcp.tool() decorator registers tools with this server instance.
    mcp = FastMCP(
        "gemini-faf-mcp",
        version=__version__,
        instructions="FAF — Universal AI context from IANA-registered .faf files",
    )
  • Import statements for faf_sdk functions and FafParseError. These external SDK functions (parse_file, validate) are core helpers used by faf_agents to parse and validate .faf files.
    from faf_sdk import parse_file, parse, validate, find_faf_file, stringify
    from faf_sdk.parser import FafParseError
    from models import get_model, list_models
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It describes the tool's action (exporting and writing to a file) and compatibility, but lacks details on behavioral traits such as error handling (e.g., what happens if the .faf file is missing), permissions required, or side effects (e.g., overwriting existing AGENTS.md). This is a significant gap for a tool that writes files.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose in the first sentence, followed by compatibility details and output location. Each sentence adds value: the first defines the action, the second adds context on compatibility, and the third specifies the output. There is no redundant or wasted text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema (which likely covers return values), the description need not explain outputs. However, with no annotations and low parameter coverage, it should do more to address behavioral aspects like file writing implications or error conditions. The description is adequate for basic understanding but lacks depth for safe and effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It mentions the input ('.faf file') and output ('AGENTS.md'), but does not explain the 'path' parameter's semantics beyond the default 'project.faf'. No details on path format, allowed values, or how it relates to the export process are provided, leaving the parameter partially undocumented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Export AGENTS.md content from a .faf file') and the resource involved ('.faf file' and 'AGENTS.md'). It distinguishes this tool from siblings by focusing on exporting agent context files, unlike tools like faf_read (general reading), faf_validate (validation), or faf_init (initialization).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when needing to export agent context for AI tools, but does not explicitly state when to use this tool versus alternatives like faf_read (which might read other content) or faf_context (which might handle context differently). No exclusions or prerequisites are mentioned, leaving usage context somewhat open-ended.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Wolfe-Jam/gemini-faf-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server