Skip to main content
Glama

get comments

Retrieve user comments from TabNews content by specifying the username and slug parameters to analyze discussions and feedback.

Instructions

get comments from a content on tabnews api

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYesThe username to get the content
slugYesThe slug to get the content

Implementation Reference

  • The handler function for the 'get comments' tool. It fetches comments using the getContentChildren service and returns a formatted MCP text response with JSON data.
    handler: async (params: GetContentParams): Promise<McpResponse> => {
      try {
        const result = await getContentChildren({
          username: params.username,
          slug: params.slug,
        });
    
        const content: McpTextContent = {
          type: "text",
          text: `Comments:\n\n${JSON.stringify(result, null, 2)}`,
        };
    
        return {
          content: [content],
        };
      } catch (error) {
        if (error instanceof Error) {
          throw new Error(`Failed to get comments: ${error.message}`);
        } else {
          throw new Error("Failed to get comments");
        }
      }
    },
  • Zod schema defining the input parameters for the 'get comments' tool: username and slug.
    parameters: {
      username: z.string().describe("The username to get the content"),
      slug: z.string().describe("The slug to get the content"),
    },
  • src/index.ts:52-57 (registration)
    Registration of the 'get comments' tool (imported as getContentChildrenTool) with the MCP server using server.tool().
    server.tool(
      getContentChildrenTool.name,
      getContentChildrenTool.description,
      getContentChildrenTool.parameters,
      getContentChildrenTool.handler
    );
  • Supporting API service function that fetches the comments (children) from the TabNews API endpoint.
    export async function getContentChildren({
      username,
      slug,
    }: GetContentParams): Promise<TabNewsContentChildren[]> {
      const response = await fetch(
        `${TABNEWS_API_URL}/contents/${username}/${slug}/children`
      );
      const data = await response.json();
    
      return data as TabNewsContentChildren[];
    }
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 states the tool 'gets comments' but doesn't explain what that entails—for example, whether it returns all comments, paginated results, or specific metadata. Without annotations, this leaves significant gaps in understanding the tool's behavior.

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 a single, straightforward sentence that efficiently conveys the core purpose without unnecessary words. It's appropriately sized for a simple tool, though it could be slightly more structured by explicitly mentioning the parameters or context.

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 lack of annotations and output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., comment data format, error handling) or any behavioral nuances. For a tool with two required parameters and no structured output information, this leaves too much undefined for effective use.

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?

The input schema has 100% description coverage, clearly documenting both parameters ('username' and 'slug') and their purposes. The description adds no additional parameter information beyond what the schema provides, so it meets the baseline score of 3 for adequate but not enhanced parameter semantics.

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 action ('get comments') and resource ('from a content on tabnews api'), making the purpose understandable. However, it doesn't distinguish this tool from its siblings (like 'get content' or 'get contents'), which could also potentially retrieve comments or related data, so it doesn't reach the highest score.

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 siblings like 'get content' and 'get contents' available, it's unclear if this is the primary method for retrieving comments or if there are specific scenarios where it should be preferred over other tools.

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/renant/mcp-tabnews'

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