Skip to main content
Glama
soil-dev

capsulemcp

list_opportunity_entries

Retrieve timeline entries for a sales opportunity, including notes, emails, and completed tasks, sorted newest first. Check the latest activity on any deal.

Instructions

List timeline entries (notes, captured emails, completed-task records) for an opportunity. Returns entries newest-first. Each entry has a type ('note', 'email', 'task'), free-text content, and timestamps. Use this to answer 'what's the latest on deal X?' For party or project timelines, use list_party_entries or list_project_entries respectively.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
opportunityIdYes
pageNo
perPageNo
embedNoComma-separated embeds, e.g. 'attachments,participants'

Implementation Reference

  • The actual handler function for list_opportunity_entries. It calls capsuleGet to fetch entries from /opportunities/{opportunityId}/entries and returns the data along with a nextPage token for pagination.
    export async function listOpportunityEntries(input: z.infer<typeof listOpportunityEntriesSchema>) {
      const { data, nextPage } = await capsuleGet<{ entries: unknown[] }>(
        `/opportunities/${input.opportunityId}/entries`,
        { embed: input.embed, page: input.page, perPage: input.perPage },
      );
      return { ...data, nextPage };
    }
  • Zod schema for the list_opportunity_entries tool. Requires opportunityId (positive int), plus optional pagination parameters (page, perPage, embed).
    export const listOpportunityEntriesSchema = z.object({
      opportunityId: z.number().int().positive(),
      ...listEntriesPagination,
    });
  • src/server.ts:666-672 (registration)
    Registration of the list_opportunity_entries tool on the MCP server, calling registerTool with the name, description, schema, and handler function.
    registerTool(
      server,
      "list_opportunity_entries",
      "List timeline entries (notes, captured emails, completed-task records) for an opportunity. Returns entries newest-first. Each entry has a type ('note', 'email', 'task'), free-text content, and timestamps. Use this to answer 'what's the latest on deal X?' For party or project timelines, use list_party_entries or list_project_entries respectively.",
      listOpportunityEntriesSchema,
      listOpportunityEntries,
    );
  • The registerTool helper that wraps the handler and registers it with the McpServer SDK, wrapping return values in MCP text-content format.
    export function registerTool<Schema extends z.ZodObject<ZodRawShape>>(
      server: McpServer,
      name: string,
      description: string,
      schema: Schema,
      handler: (input: z.infer<Schema>) => Promise<unknown>,
    ): void {
      // Use the SDK config-form registerTool with the full Zod schema. The
      // deprecated shape overload rebuilds z.object(schema.shape), which drops
      // object-level refinements such as superRefine.
      const registerWithSchema = server.registerTool.bind(server) as (
        toolName: string,
        config: { description: string; inputSchema: Schema },
        callback: (input: z.infer<Schema>) => Promise<CallToolResult>,
      ) => void;
    
      registerWithSchema(name, { description, inputSchema: schema }, async (input) => {
        const result = await handler(input);
        return wrapAsText(result);
      });
    }
  • The capsuleGet helper used by the handler to make GET requests to the Capsule API, returning paginated results with a nextPage link parser.
    export async function capsuleGet<T>(path: string, params?: QueryParams): Promise<PagedResult<T>> {
      const token = getToken();
      const url = buildUrl(path, params);
      const { res, cleanup } = await doFetch(url, { headers: baseHeaders(token) });
      try {
        const data = await handleResponse<T>(res);
        const nextPage = parseNextPage(res.headers.get("Link"));
        return { data, nextPage };
      } finally {
        cleanup();
      }
    }
Behavior4/5

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

Discloses important behavior: returns entries newest-first, entry types, and content fields. However, with no annotations, it could mention idempotency or pagination behavior but still provides solid transparency.

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 sentences perfectly front-loaded: first covers purpose and behavior, second covers usage guidance. No wasted 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?

Covers purpose, sorting, entry types, and sibling alternatives. Lacks pagination details but sufficient given the tool's simplicity and no output schema.

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?

Adds meaning about return format and fields beyond schema, but does not detail each parameter's semantics beyond what the schema provides. Schema coverage is low, but description partially compensates.

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?

Clearly states it lists timeline entries for an opportunity, mentioning specific entry types (notes, emails, tasks). Explicitly distinguishes from sibling tools list_party_entries and list_project_entries.

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

Usage Guidelines5/5

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

Provides explicit usage example ('what's the latest on deal X?') and contrasts with alternatives for party or project timelines, guiding when not to use this tool.

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/soil-dev/capsulemcp'

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