Skip to main content
Glama

ig_get_hashtag

Retrieve complete hashtag details, metrics, and metadata using the hashtag ID from a search result.

Instructions

Get hashtag information by ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hashtag_idYesHashtag ID (from ig_search_hashtag)

Implementation Reference

  • The handler function for the 'ig_get_hashtag' tool. It takes a 'hashtag_id' string parameter, makes a GET request to the Meta Graph API via client.ig() with fields 'id,name,media_count', and returns the hashtag info as JSON text.
    server.tool(
      "ig_get_hashtag",
      "Get hashtag information by ID.",
      {
        hashtag_id: z.string().describe("Hashtag ID (from ig_search_hashtag)"),
      },
      async ({ hashtag_id }) => {
        try {
          const { data, rateLimit } = await client.ig("GET", `/${hashtag_id}`, {
            fields: "id,name,media_count",
          });
          return { content: [{ type: "text", text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] };
        } catch (error) {
          return { content: [{ type: "text", text: `Get hashtag failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true };
        }
      }
    );
  • Zod schema for the input parameter 'hashtag_id' (a required string describing 'Hashtag ID (from ig_search_hashtag)').
    {
      hashtag_id: z.string().describe("Hashtag ID (from ig_search_hashtag)"),
  • The tool is registered via server.tool() call with name 'ig_get_hashtag' and description 'Get hashtag information by ID.'
    server.tool(
      "ig_get_hashtag",
      "Get hashtag information by ID.",
      {
        hashtag_id: z.string().describe("Hashtag ID (from ig_search_hashtag)"),
      },
      async ({ hashtag_id }) => {
        try {
          const { data, rateLimit } = await client.ig("GET", `/${hashtag_id}`, {
            fields: "id,name,media_count",
          });
          return { content: [{ type: "text", text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] };
        } catch (error) {
          return { content: [{ type: "text", text: `Get hashtag failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true };
        }
      }
    );
  • src/index.ts:46-46 (registration)
    The registration function 'registerIgHashtagTools' is called to register all hashtag tools including 'ig_get_hashtag'.
    registerIgHashtagTools(server, client);
  • src/index.ts:16-16 (registration)
    The import statement that brings in 'registerIgHashtagTools' from the hashtags.ts module.
    import { registerIgHashtagTools } from "./tools/instagram/hashtags.js";
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 traits. It does not disclose any behaviors such as authentication requirements, rate limits, error cases, or the nature of the returned data. The minimal description offers no transparency beyond the basic action.

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

Conciseness3/5

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

The description is extremely concise (5 words), but it sacrifices useful information. While it is structurally simple, it is not well-structured with front-loaded key details. It could include more context without losing conciseness.

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 is simple with one parameter and no output schema, the description should at least hint at the return value or source of the ID. It fails to provide sufficient context for an agent to understand the full usage pattern.

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 coverage is 100% with a single parameter described as 'Hashtag ID (from ig_search_hashtag)'. The description adds no further meaning beyond the schema, so baseline score of 3 is appropriate.

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), resource (hashtag information), and method (by ID). It distinguishes from siblings like ig_get_hashtag_recent and ig_get_hashtag_top by being the generic retrieval tool. However, it does not specify what 'information' includes.

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 on when to use this tool versus siblings such as ig_get_hashtag_recent or ig_get_hashtag_top. The schema mentions that the ID comes from ig_search_hashtag, but the description itself lacks context for appropriate usage.

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/mikusnuz/meta-mcp'

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