Skip to main content
Glama

list_threads

Retrieve discussion threads from an Ed Discussion course with configurable sorting, pagination, and limits for efficient content management.

Instructions

List discussion threads in a course

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
course_idYesCourse ID
limitNoMax threads to return (1-100)
offsetNoPagination offset
sortNoSort ordernew

Implementation Reference

  • Registration and handler logic for the "list_threads" MCP tool. It parses input using zod, calls the API client's `listThreads` method, and formats the result.
    server.tool(
      "list_threads",
      "List discussion threads in a course",
      {
        course_id: z.number().describe("Course ID"),
        limit: z.number().min(1).max(100).default(30).describe("Max threads to return (1-100)"),
        offset: z.number().min(0).default(0).describe("Pagination offset"),
        sort: z
          .enum(["new", "top", "active", "unanswered"])
          .default("new")
          .describe("Sort order"),
      },
      async ({ course_id, limit, offset, sort }) => {
        try {
          const threads = await api.listThreads(course_id, { limit, offset, sort });
          const summary = threads.map((t) => ({
            id: t.id,
            number: t.number,
            type: t.type,
            title: t.title,
            category: t.category,
            subcategory: t.subcategory,
            reply_count: t.reply_count,
            is_answered: t.is_answered,
            is_pinned: t.is_pinned,
            is_private: t.is_private,
            created_at: t.created_at,
            user: t.user,
          }));
          return ok(summary);
        } catch (err) {
          return fail(err);
        }
      }
    );
  • API client method that performs the network request to fetch discussion threads.
    async listThreads(
      courseId: number,
      opts: { limit?: number; offset?: number; sort?: string } = {}
    ): Promise<EdThread[]> {
      const params: Record<string, string | number> = {};
      if (opts.limit !== undefined) params.limit = opts.limit;
      if (opts.offset !== undefined) params.offset = opts.offset;
      if (opts.sort) params.sort = opts.sort;
    
      const res = await this.request<EdListThreadsResponse>(
        "GET",
        `courses/${courseId}/threads`,
        undefined,
        params
      );
      return res.threads;
    }
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 fails to indicate that this is a read-only operation, does not explain pagination semantics despite the presence of limit/offset parameters, and omits what the tool returns or how it handles invalid course IDs.

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

Conciseness4/5

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

The description is extremely concise at five words, front-loaded with the action verb, and contains no redundant or wasted language. However, given the lack of annotations and output schema, it may be inappropriately terse rather than appropriately sized.

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

Completeness2/5

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

Despite having complete schema documentation for inputs, the description is insufficient for a tool with no annotations and no output schema. It lacks critical context about return format, pagination behavior, and differentiation from sibling search/retrieval tools necessary for correct agent invocation.

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?

With 100% schema description coverage, the schema adequately documents all four parameters (course_id, limit, offset, sort) including constraints and defaults. The description adds no additional semantic context beyond the schema, which aligns with the baseline score for high-coverage schemas.

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 (List), resource (discussion threads), and scope (in a course). However, it fails to distinguish from sibling tools like 'search_threads' or 'get_course_thread', leaving ambiguity about which listing/retrieval tool to use.

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 like 'search_threads' (which likely supports filtering) or 'get_thread' (which retrieves a specific thread). There are no explicit prerequisites, exclusions, or alternative recommendations.

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/rob-9/edstem-mcp'

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