Skip to main content
Glama

get_instagram_user

Retrieve Instagram user information using URL, alias, or ID to access profile data and details through data scraping.

Instructions

Get Instagram user information by URL, alias or ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timeoutNoMax scrapping execution timeout (in seconds)
userYesUser ID, alias or URL

Implementation Reference

  • Handler function that executes the get_instagram_user tool logic. Prepares request data with user and timeout, calls makeRequest to the Instagram user API endpoint, and returns the JSON response or an error message.
    async ({ user, timeout }) => {
      const requestData = { timeout, user };
      log("Starting Instagram user lookup for:", user);
      try {
        const response = await makeRequest(API_CONFIG.ENDPOINTS.INSTAGRAM_USER, requestData);
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(response, null, 2)
            }
          ]
        };
      } catch (error) {
        log("Instagram user lookup error:", error);
        return {
          content: [
            {
              type: "text",
              text: `Instagram user API error: ${formatError(error)}`
            }
          ],
          isError: true
        };
      }
    }
  • Zod input schema defining parameters: user (string, required), timeout (number, optional default 300). Used in tool registration.
      user: z.string().describe("User ID, alias or URL"),
      timeout: z.number().default(300).describe("Timeout in seconds")
    },
  • src/index.ts:301-334 (registration)
    Registration of the get_instagram_user tool on the MCP server, specifying name, description, input schema, and handler function.
    server.tool(
      "get_instagram_user",
      "Get Instagram user information",
      {
        user: z.string().describe("User ID, alias or URL"),
        timeout: z.number().default(300).describe("Timeout in seconds")
      },
      async ({ user, timeout }) => {
        const requestData = { timeout, user };
        log("Starting Instagram user lookup for:", user);
        try {
          const response = await makeRequest(API_CONFIG.ENDPOINTS.INSTAGRAM_USER, requestData);
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(response, null, 2)
              }
            ]
          };
        } catch (error) {
          log("Instagram user lookup error:", error);
          return {
            content: [
              {
                type: "text",
                text: `Instagram user API error: ${formatError(error)}`
              }
            ],
            isError: true
          };
        }
      }
    );
  • Helper function makeRequest used by the handler to perform authenticated HTTPS POST requests to the AnySite.io API endpoints.
    const makeRequest = (endpoint: string, data: any, method: string = "POST"): Promise<any> => {
      return new Promise((resolve, reject) => {
        const url = new URL(endpoint, API_CONFIG.BASE_URL);
        const postData = JSON.stringify(data);
    
        const options = {
          hostname: url.hostname,
          port: url.port || 443,
          path: url.pathname,
          method: method,
          headers: {
            "Content-Type": "application/json",
            "Content-Length": Buffer.byteLength(postData),
            "access-token": API_KEY,
            ...(ACCOUNT_ID && { "x-account-id": ACCOUNT_ID })
          }
        };
    
        const req = https.request(options, (res) => {
          let responseData = "";
          res.on("data", (chunk) => {
            responseData += chunk;
          });
    
          res.on("end", () => {
            try {
              const parsed = JSON.parse(responseData);
              if (res.statusCode && res.statusCode >= 200 && res.statusCode < 300) {
                resolve(parsed);
              } else {
                reject(new Error(`API error ${res.statusCode}: ${JSON.stringify(parsed)}`));
              }
            } catch (e) {
              reject(new Error(`Failed to parse response: ${responseData}`));
            }
          });
        });
    
        req.on("error", (error) => {
          reject(error);
        });
    
        req.write(postData);
        req.end();
      });
    };
  • API endpoint path definition for Instagram user data in the API_CONFIG.ENDPOINTS object.
    INSTAGRAM_USER: "/api/instagram/user",
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'Get' but doesn't specify if this is a read-only operation, whether it requires authentication, rate limits, or what happens on errors. The description lacks critical behavioral context for a tool that likely involves web scraping.

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 a single, efficient sentence that directly states the tool's purpose without any wasted words. It's appropriately sized and front-loaded with essential information.

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?

For a tool with no annotations, no output schema, and likely involving web scraping (implied by 'scrapping' in timeout description), the description is inadequate. It doesn't explain what information is returned, error conditions, or important behavioral constraints like rate limits or authentication requirements.

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%, so the schema already documents both parameters thoroughly. The description adds minimal value by mentioning 'URL, alias or ID' for the user parameter, but doesn't provide additional context beyond what's in the schema. Baseline 3 is appropriate when schema does the heavy lifting.

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 ('Get') and resource ('Instagram user information'), and specifies the input types ('by URL, alias or ID'). However, it doesn't explicitly distinguish this tool from its sibling Instagram tools (like get_instagram_user_posts), which would require a 5.

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. It doesn't mention sibling tools or suggest scenarios where this tool is preferred over others, leaving the agent to infer usage context.

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/anysiteio/hdw-mcp-server'

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