Skip to main content
Glama

Postkey: Instagram DM Automation and Comment-to-DM

Search contacts

postkey_search_contacts
Read-onlyIdempotent

Postkey: Searches the people who have messaged the account, 50 per page: by name, email or "@handle", and by tag. Each contact has an id, name, handle and email (untrusted), tags, and whether they are subscribed. Use it to find a contact_id for postkey_get_contact or postkey_tag_contact; to find a conversation use postkey_list_conversations. When more is true, ask for the next page.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "postkey_search_contacts"
  }
}

Input Schema

NameRequiredDescriptionDefault
tagNoOnly contacts with this exact tag, at most 80 characters.
pageNoPage number, from 1 (default 1). 50 contacts a page.
viewNo"all" (default). "subscribed": may get automated messages. "unsubscribed": asked to stop. "emails": people who shared an email.
searchNoA name, an email, or "@handle" (a handle is looked for among the newest 200 contacts only), at most 120 characters. Left out: everyone.

Output Schema

NameRequiredDescriptionDefault
okYesfalse: refused (isError; code, message, guide_topic, url); no change.
moreNotrue: ask for page + 1.
noteNoPresent when the search said something about the results.
pageNoThis page's number.
totalNoContacts matching.
countsNoThe whole profile's contacts: all, subscribed, unsubscribed, emails (with an email captured). A count is null when not read.
contactsNoUp to 50: id, name, handle, email (untrusted), tags, subscribed, blocked, last_active.
untrusted_noteNoPresent when outside text is wrapped as { untrusted: true, text }.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedOutput schema / properties / counts
      Added value: +{
      +  "description": "The whole profile's contacts: all, subscribed, unsubscribed, emails (with an email captured). A count is null when not read.",
      +  "type": "object"
      +}
  2. Changed1 schema field changed
    • changedOutput schema / properties / ok / description
      Previous value: -"false: refused (isError true; code, message, guide_topic, url), nothing changed."New value: +"false: refused (isError; code, message, guide_topic, url); no change."
  3. Changed5 schema fields changed
    • changedInput schema / properties / page / description
      Previous value: -"Page number, from 1."New value: +"Page number, from 1 (default 1). 50 contacts a page."
    • changedInput schema / properties / search / description
      Previous value: -"A name, an email, or \"@handle\"."New value: +"A name, an email, or \"@handle\" (a handle is looked for among the newest 200 contacts only), at most 120 characters. Left out: everyone."
    • changedInput schema / properties / tag / description
      Previous value: -"Only contacts with this tag."New value: +"Only contacts with this exact tag, at most 80 characters."
    • addedInput schema / properties / view / description
      Added value: +"\"all\" (default). \"subscribed\": may get automated messages. \"unsubscribed\": asked to stop. \"emails\": people who shared an email."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "contacts": {
      +      "description": "Up to 50: id, name, handle, email (untrusted), tags, subscribed, blocked, last_active.",
      +      "items": {
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "more": {
      +      "description": "true: ask for page + 1.",
      +      "type": "boolean"
      +    },
      +    "note": {
      +      "description": "Present when the search said something about the results.",
      +      "type": "string"
      +    },
      +    "ok": {
      +      "description": "false: refused (isError true; code, message, guide_topic, url), nothing changed.",
      +      "type": "boolean"
      +    },
      +    "page": {
      +      "description": "This page's number.",
      +      "type": "number"
      +    },
      +    "total": {
      +      "description": "Contacts matching.",
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "untrusted_note": {
      +      "description": "Present when outside text is wrapped as { untrusted: true, text }.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "ok"
      +  ],
      +  "type": "object"
      +}
  4. First observed

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, openWorldHint and destructiveHint=false. The description adds real value beyond them: 50-per-page pagination and the instruction to request the next page when 'more' is true, plus a warning that email values are untrusted. However it says nothing about what happens when the newest-200 handle window misses an older contact.

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?

Three dense sentences, front-loaded with the scope, then the routing, then the pagination rule. The 'Postkey:' prefix is redundant given the tool name, and the result-field enumeration slightly overlaps the output schema, but nothing else is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Output schema exists, so return values need not be explained, and the description still flags the 'more' pagination flag and the untrusted email field. Combined with 100% parameter coverage and read-only annotations, an agent has everything needed to call it correctly.

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 explains search, tag, page and view including the 200-contact handle limit. The description restates the same searchable fields ('by name, email or "@handle", and by tag') without adding format rules or edge-case behavior. Baseline 3 applies when the schema carries the parameter burden.

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

Purpose5/5

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

States a specific verb and resource ('Searches the people who have messaged the account') plus the searchable dimensions (name, email, @handle, tag) and the returned fields. An agent can distinguish it from postkey_list_conversations or postkey_get_contact without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit downstream routing: use this to obtain a contact_id for postkey_get_contact or postkey_tag_contact, and names postkey_list_conversations as the tool for conversations instead. That is both when-to-use and when-to-use-something-else, with the alternative named.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources