Skip to main content
Glama

get_context

Retrieve architectural decisions to understand a project's codebase at the start of each session. Filter by category or search for specific decisions.

Instructions

Get all architectural decisions for this project. Call this at the START of every session to understand the codebase.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoFilter by category (optional)
queryNoSearch for specific decisions (optional)

Implementation Reference

  • The 'get_context' tool logic, which retrieves and optionally filters architectural decisions from the lore store.
    if (name === "get_context") {
      const store = readStore();
    
      if (store.decisions.length === 0) {
        return {
          content: [
            {
              type: "text",
              text: "No architectural decisions recorded yet.\n\nRun `lore init` to extract decisions from existing code.",
            },
          ],
        };
      }
    
      let decisions = store.decisions;
    
      // filter by category
      if (args?.category) {
        decisions = decisions.filter((d) =>
          d.category
            .toLowerCase()
            .includes((args.category as string).toLowerCase())
        );
      }
    
      // filter by query
      if (args?.query) {
        const q = (args.query as string).toLowerCase();
        decisions = decisions.filter(
          (d) =>
            d.decision.toLowerCase().includes(q) ||
            d.reason.toLowerCase().includes(q) ||
            d.category.toLowerCase().includes(q)
        );
      }
    
      const summary = decisions
        .map(
          (d) =>
            `[${d.category.toUpperCase()}] ${d.decision}\n` +
            `  → Reason: ${d.reason}\n` +
            `  → Constraints: ${
              d.constraints.length > 0
                ? d.constraints.join(", ")
                : "none"
            }`
        )
        .join("\n\n");
    
      return {
        content: [
          {
            type: "text",
            text:
              `LORE Context — ${decisions.length} decisions\n` +
              `${"─".repeat(40)}\n\n` +
              summary,
          },
        ],
      };
    }
  • src/index.ts:188-205 (registration)
    The registration of 'get_context' in the ListToolsRequestSchema handler.
    {
      name: "get_context",
      description:
        "Get all architectural decisions for this project. Call this at the START of every session to understand the codebase.",
      inputSchema: {
        type: "object",
        properties: {
          category: {
            type: "string",
            description: "Filter by category (optional)",
          },
          query: {
            type: "string",
            description: "Search for specific decisions (optional)",
          },
        },
      },
    },
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 of behavioral disclosure. It mentions the tool retrieves decisions but doesn't describe key behaviors: whether it returns all decisions at once or paginates, what format the output is in, if there are rate limits, or authentication requirements. The instruction to call at session start implies it's foundational but lacks operational details.

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 highly concise and front-loaded: two sentences with zero waste. The first sentence states the purpose, and the second provides usage guidance, both earning their place without redundancy or fluff.

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 no annotations and no output schema, the description is incomplete for a tool that likely returns complex data (architectural decisions). It covers purpose and high-level usage but lacks details on output format, error handling, or behavioral constraints. For a retrieval tool with 2 parameters and no structured output info, this is minimally adequate but has clear gaps.

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 100%, so the schema already documents both optional parameters ('category' and 'query') with descriptions. The description doesn't add any meaning beyond what the schema provides—it doesn't explain how filtering or searching works, example categories, or query syntax. Baseline 3 is appropriate when the schema handles parameter documentation.

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 tool's purpose: 'Get all architectural decisions for this project.' It specifies the resource (architectural decisions) and scope (this project). However, it doesn't explicitly differentiate from sibling tools like 'get_gaps' or 'record_decision' beyond implying this is for retrieval rather than recording.

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

Usage Guidelines4/5

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

The description provides explicit usage guidance: 'Call this at the START of every session to understand the codebase.' This gives clear context for when to use it (session initialization). However, it doesn't specify when NOT to use it or mention alternatives like the sibling tools, leaving some gaps in comparative guidance.

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/EliotShift/lore-mcp'

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