Skip to main content
Glama

get content

Retrieve specific content from TabNews API by providing username and slug parameters to access articles or posts.

Instructions

get content from tabnews api

Input Schema

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

Implementation Reference

  • The handler function that executes the 'get content' tool logic, calling the API service and returning MCP formatted response.
    handler: async (params: GetContentParams): Promise<McpResponse> => {
      try {
        const result = await getContent({
          username: params.username,
          slug: params.slug,
        });
    
        const content: McpTextContent = {
          type: "text",
          text: `Content ${params.slug} from ${
            params.username
          }:\n\n${JSON.stringify(result, null, 2)}`,
        };
    
        return {
          content: [content],
        };
      } catch (error) {
        if (error instanceof Error) {
          throw new Error(`Failed to get content: ${error.message}`);
        } else {
          throw new Error("Failed to get content");
        }
      }
    },
  • Zod schema defining input parameters for the 'get content' 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:45-50 (registration)
    Registration of the 'get content' tool with the MCP server using server.tool().
    server.tool(
      getContentTool.name,
      getContentTool.description,
      getContentTool.parameters,
      getContentTool.handler
    );
  • Helper function that performs the actual HTTP fetch to retrieve content from TabNews API.
    export async function getContent({
      username,
      slug,
    }: GetContentParams): Promise<TabNewsContentWithBody> {
      const response = await fetch(
        `${TABNEWS_API_URL}/contents/${username}/${slug}`
      );
      const data = await response.json();
    
      return data as TabNewsContentWithBody;
    }
  • TypeScript interface defining the parameters for getting content.
    export interface GetContentParams {
      username: string;
      slug: string;
    }
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. It states 'get content' which implies a read-only operation, but doesn't disclose behavioral traits like authentication needs, rate limits, error handling, or what 'content' entails (e.g., format, size, metadata). This is inadequate for a tool with no annotation coverage.

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, efficient sentence with zero waste. However, it's under-specified rather than concise—it lacks necessary detail to be truly helpful, but within its limited scope, it's structured appropriately.

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 no annotations, no output schema, and a vague description, this is incomplete for a tool with 2 required parameters. The description doesn't compensate for missing context about what 'content' includes, how it's returned, or usage distinctions from siblings, leaving significant gaps.

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 clear parameter descriptions in the schema. The description adds no meaning beyond this, as it doesn't explain how username and slug combine to identify content or provide examples. Baseline 3 is appropriate since the schema does the heavy lifting.

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 'get content from tabnews api' states the action (get) and resource (content) but is vague about scope and specificity. It doesn't distinguish this tool from sibling tools like 'get contents' or 'get contents by user', leaving ambiguity about what exactly this tool retrieves versus those alternatives.

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?

No guidance is provided on when to use this tool versus alternatives like 'get contents' or 'get contents by user'. The description implies it retrieves content but doesn't specify context, prerequisites, or exclusions, leaving the agent to guess based on parameter names alone.

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