Skip to main content
Glama

get_news

Retrieve school news and announcements from the N Lobby portal with options to filter by category, sort results, and limit items.

Instructions

Retrieve school news

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoFilter by category (optional)
limitNoMaximum number of news items to retrieve (optional, default: 10)
sortNoSort order: 'newest' (default), 'oldest', 'title-asc', 'title-desc'

Implementation Reference

  • Executes the get_news tool: fetches news via api.getNews(), filters by category if provided, sorts by specified order (default newest), limits results, returns JSON stringified list or error message with auth instructions.
    case "get_news":
      try {
        const {
          category,
          limit = 10,
          sort = "newest",
        } = args as {
          category?: string;
          limit?: number;
          sort?: "newest" | "oldest" | "title-asc" | "title-desc";
        };
        const news = await this.api.getNews();
        let filteredNews = category
          ? news.filter((n) => n.category === category)
          : news;
    
        // Sort the news
        switch (sort) {
          case "oldest":
            filteredNews.sort(
              (a, b) =>
                new Date(a.publishedAt || 0).getTime() -
                new Date(b.publishedAt || 0).getTime(),
            );
            break;
          case "title-asc":
            filteredNews.sort((a, b) =>
              (a.title || "").localeCompare(b.title || ""),
            );
            break;
          case "title-desc":
            filteredNews.sort((a, b) =>
              (b.title || "").localeCompare(a.title || ""),
            );
            break;
          case "newest":
          default:
            filteredNews.sort(
              (a, b) =>
                new Date(b.publishedAt || 0).getTime() -
                new Date(a.publishedAt || 0).getTime(),
            );
            break;
        }
    
        if (limit > 0) {
          filteredNews = filteredNews.slice(0, limit);
        }
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(filteredNews, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error: ${error instanceof Error ? error.message : "Unknown error"}\n\nTo authenticate:\n1. Login to N Lobby in your browser\n2. Open Developer Tools (F12)\n3. Go to Application/Storage tab\n4. Copy cookies and use the set_cookies tool\n5. Use health_check to verify connection`,
            },
          ],
        };
      }
  • Input schema defining parameters for get_news tool: optional category filter, limit (default 10), sort order enum.
    inputSchema: {
      type: "object",
      properties: {
        category: {
          type: "string",
          description: "Filter by category (optional)",
        },
        limit: {
          type: "number",
          description:
            "Maximum number of news items to retrieve (optional, default: 10)",
          minimum: 1,
          default: 10,
        },
        sort: {
          type: "string",
          description:
            "Sort order: 'newest' (default), 'oldest', 'title-asc', 'title-desc'",
          enum: ["newest", "oldest", "title-asc", "title-desc"],
        },
      },
    },
  • src/server.ts:157-182 (registration)
    Tool registration entry in ListTools response, including name, description, and input schema for get_news.
    {
      name: "get_news",
      description: "Retrieve school news",
      inputSchema: {
        type: "object",
        properties: {
          category: {
            type: "string",
            description: "Filter by category (optional)",
          },
          limit: {
            type: "number",
            description:
              "Maximum number of news items to retrieve (optional, default: 10)",
            minimum: 1,
            default: 10,
          },
          sort: {
            type: "string",
            description:
              "Sort order: 'newest' (default), 'oldest', 'title-asc', 'title-desc'",
            enum: ["newest", "oldest", "title-asc", "title-desc"],
          },
        },
      },
    },
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. 'Retrieve school news' implies a read-only operation but doesn't specify whether authentication is required, what format the news items return in, whether there are rate limits, or if this is a paginated endpoint. For a tool with 3 parameters and no annotation coverage, this leaves significant behavioral gaps.

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 extremely concise at just two words ('Retrieve school news'), with zero wasted language. It's front-loaded with the core action and resource. For a simple retrieval tool, this brevity is appropriate and efficient.

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?

Given the tool has 3 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain what 'school news' encompasses, what format the results take, whether authentication is needed, or how results are structured. For a retrieval tool with filtering/sorting parameters, more context about the resource and return values would be helpful.

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%, with all parameters well-documented in the schema itself (category filtering, limit with default, sort with enum options). The description adds no additional parameter semantics beyond what's already in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

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

Purpose3/5

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

The description 'Retrieve school news' clearly states the verb (retrieve) and resource (school news), making the basic purpose understandable. However, it doesn't distinguish this from sibling tools like 'get_news_detail' or 'mark_news_as_read', leaving ambiguity about when to use this list-style retrieval versus the detail view. The purpose is clear but lacks 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. With sibling tools like 'get_news_detail' (likely for single news items) and 'mark_news_as_read' (for updating news status), the agent receives no explicit or implicit direction about when this list retrieval is appropriate versus those other operations. No context or exclusions are mentioned.

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/minagishl/nlobby-cli'

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