Skip to main content
Glama

Read Advisor Log

read_advisor_log
Read-only

Review past Opus advisor consultations to understand previous advice and decision context for your project.

Instructions

Read the consultation log from prior Opus advisor calls for this project. Useful for reviewing past advice or getting context on decisions already made.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
last_nNoNumber of recent consultations to return. Omit for the full log.

Implementation Reference

  • The tool handler for 'read_advisor_log' – reads the advisor log, optionally filters by last_n consultations, and returns the content.
    }, async ({ last_n }) => {
      try {
        const log = await readAdvisorLog();
        if (!log) {
          return {
            content: [
              { type: "text" as const, text: "No advisor consultations yet." },
            ],
          };
        }
        if (last_n) {
          const recent = getRecentHistory(log, last_n, Infinity);
          return {
            content: [{ type: "text" as const, text: recent || "No consultations found." }],
          };
        }
        return { content: [{ type: "text" as const, text: log }] };
      } catch (err) {
        const message =
          err instanceof Error ? err.message : "Unknown error reading log";
        return {
          content: [{ type: "text" as const, text: `Error: ${message}` }],
          isError: true,
        };
      }
  • src/index.ts:520-560 (registration)
    Registration of the 'read_advisor_log' tool with the MCP server, including title, description, inputSchema, annotations, and handler.
    server.registerTool("read_advisor_log", {
      title: "Read Advisor Log",
      description:
        "Read the consultation log from prior Opus advisor calls for this project. " +
        "Useful for reviewing past advice or getting context on decisions already made.",
      inputSchema: {
        last_n: z
          .number()
          .optional()
          .describe(
            "Number of recent consultations to return. Omit for the full log.",
          ),
      },
      annotations: {
        readOnlyHint: true,
      },
    }, async ({ last_n }) => {
      try {
        const log = await readAdvisorLog();
        if (!log) {
          return {
            content: [
              { type: "text" as const, text: "No advisor consultations yet." },
            ],
          };
        }
        if (last_n) {
          const recent = getRecentHistory(log, last_n, Infinity);
          return {
            content: [{ type: "text" as const, text: recent || "No consultations found." }],
          };
        }
        return { content: [{ type: "text" as const, text: log }] };
      } catch (err) {
        const message =
          err instanceof Error ? err.message : "Unknown error reading log";
        return {
          content: [{ type: "text" as const, text: `Error: ${message}` }],
          isError: true,
        };
      }
  • Input schema for the tool: optional 'last_n' number limiting returned consultations.
    inputSchema: {
      last_n: z
        .number()
        .optional()
        .describe(
          "Number of recent consultations to return. Omit for the full log.",
        ),
    },
  • Helper function readAdvisorLog() that reads the advisor log file from disk, returning empty string if not found.
    async function readAdvisorLog(): Promise<string> {
      try {
        return await readFile(ADVISOR_LOG, "utf-8");
      } catch {
        return "";
      }
    }
  • Helper function parseConsultations() used to split log into individual consultation entries.
    function parseConsultations(log: string): string[] {
      const parts = log.split(/(?=\n## Consultation)/);
      // First part is the header, rest are consultations
      return parts.length > 1 ? parts.slice(1) : [];
    }
Behavior4/5

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

Annotations declare readOnlyHint=true, and the description adds context about the log's content ('consultation log from prior Opus advisor calls'). There is no contradiction and additional detail is provided.

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?

Two concise sentences, both adding value: first states action, second states usefulness. No extraneous words.

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 simplicity (one optional param, no output schema), the description adequately explains what data is returned and when to use it. Minor lack of detail on format, but sufficient.

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% for the only parameter 'last_n', which already explains its meaning. The description does not add further semantics beyond the schema.

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 verb 'Read' and the resource 'consultation log from prior Opus advisor calls', and it distinguishes from sibling tools like clear_advisor_log and consult_opus.

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?

It provides context for when to use ('reviewing past advice', 'getting context on decisions'), but does not explicitly mention when not to use or name alternatives like read_advisor_meta.

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/Divinci-AI/opus-advisor-mcp'

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