Skip to main content
Glama
Supermaxman
by Supermaxman

get_projects

Retrieve OpenAI projects for your organization to monitor and manage API usage, with options to include archived projects.

Instructions

Fetches OpenAI projects for the current organization.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
include_archivedNoWhether to include archived projects. Defaults to False.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The @mcp.tool decorator registers the get_projects tool with the FastMCP server.
    @mcp.tool(description="Fetches OpenAI projects for the current organization.")
  • The async handler function that fetches OpenAI projects using the Admin API, paginates results, and processes timestamps.
    async def get_projects(
        include_archived: Annotated[
            bool, "Whether to include archived projects. Defaults to False."
        ] = False,
    ) -> list[dict]:
        """Fetches the projects for the current organization."""
    
        base_url = "https://api.openai.com/v1/organization/projects"
        params: list[tuple[str, str]] = [
            ("include_archived", include_archived),
            ("limit", 180),
        ]
        base_params = params.copy()
        url = f"{base_url}?{urlencode(base_params)}"
        results: list[dict] = []
        async with httpx.AsyncClient(
            timeout=60,
            headers={"Authorization": f"Bearer {OPENAI_ADMIN_API_KEY}"},
        ) as client:
            while url:
                response = await client.get(url)
                response.raise_for_status()
                data = response.json()
                items = data["data"]
                for item in items:
                    item["created_at"] = datetime.fromtimestamp(item["created_at"])
                    if "archived_at" in item and item["archived_at"]:
                        item["archived_at"] = datetime.fromtimestamp(item["archived_at"])
                    results.append(item)
                last_id = data.get("last_id")
                has_more = data.get("has_more")
                url = None
                if last_id and has_more:
                    params = base_params.copy()
                    params.append(("after", last_id))
                    url = f"{base_url}?{urlencode(params)}"
                    # sleep to avoid rate limiting
                    await asyncio.sleep(1.0)
        return results
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states 'fetches' which implies a read operation, but doesn't mention any behavioral traits like authentication requirements, rate limits, pagination, or what happens when no projects exist. This leaves significant gaps for a tool that interacts with organizational data.

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 a single, efficient sentence that directly states the tool's purpose without any unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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

Completeness4/5

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

Given the tool's low complexity (one optional parameter) and the presence of both a complete input schema and an output schema, the description is reasonably complete. However, the lack of annotations means some behavioral context is missing, preventing a perfect score.

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?

The description doesn't mention any parameters, but the input schema has 100% description coverage for its single parameter 'include_archived'. Since the schema fully documents this parameter, the baseline score of 3 is appropriate—the description adds no parameter information beyond what's already in the structured data.

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

Purpose4/5

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

The description clearly states the verb ('fetches') and resource ('OpenAI projects for the current organization'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from its sibling tool 'get_costs', which appears to be a different resource type, so it doesn't reach the highest score for sibling differentiation.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives, such as its sibling 'get_costs'. It doesn't mention any prerequisites, exclusions, or contextual triggers, leaving usage entirely implicit based on the tool name and purpose alone.

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/Supermaxman/mcp-server-openai'

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