Skip to main content
Glama

Postkey: Instagram DM Automation and Comment-to-DM

Finish a file upload

postkey_finish_upload

Postkey: Adds the file sent to postkey_begin_upload's link to the Library, and answers its library_item_id (use it with postkey_attach_library_item or library_item_ids). Postkey checks that the whole file arrived and is no larger than the size it began with. Nothing arrived yet: send the file to the same link, then call this again. Link ran out or wrong size: start again with postkey_begin_upload. For a video, send meta with duration_sec, width and height: each platform's length limit is checked with them before posting.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>",
      "title": "<title>",
      "kind": "<kind>"
    },
    "name": "postkey_finish_upload"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindYesWhat the file is. Only video and image files can go on a post.
metaNoFor a video: { duration_sec (seconds, decimals allowed), width, height (pixels) }, for example from ffprobe. Anything else is ignored.
pathYesThe path postkey_begin_upload answered with, as it was.
titleYesThe file's title in the Library, 1 to 300 characters.

Output Schema

NameRequiredDescriptionDefault
okYesfalse: refused (isError; code, message, guide_topic, url); no change.
nextNoWhat to do next.
noteNoPresent when the file was already in the Library.
size_bytesNoThe stored size.
library_item_idNoThe new Library file's id.

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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."
  2. Changed5 schema fields changed
    • changedInput schema / properties / kind / description
      Previous value: -"What the file is."New value: +"What the file is. Only video and image files can go on a post."
    • changedInput schema / properties / meta / description
      Previous value: -"Facts about the file: duration_sec (seconds, may have decimals), width and height (pixels). Anything else is ignored."New value: +"For a video: { duration_sec (seconds, decimals allowed), width, height (pixels) }, for example from ffprobe. Anything else is ignored."
    • changedInput schema / properties / path / description
      Previous value: -"The path postkey_begin_upload answered with."New value: +"The path postkey_begin_upload answered with, as it was."
    • changedInput schema / properties / title / description
      Previous value: -"The file's title in the Library."New value: +"The file's title in the Library, 1 to 300 characters."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "library_item_id": {
      +      "description": "The new Library file's id.",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "next": {
      +      "description": "What to do next.",
      +      "type": "string"
      +    },
      +    "note": {
      +      "description": "Present when the file was already in the Library.",
      +      "type": "string"
      +    },
      +    "ok": {
      +      "description": "false: refused (isError true; code, message, guide_topic, url), nothing changed.",
      +      "type": "boolean"
      +    },
      +    "size_bytes": {
      +      "description": "The stored size.",
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    }
      +  },
      +  "required": [
      +    "ok"
      +  ],
      +  "type": "object"
      +}
  3. First observed

TDQS

A4.3/5.0
Behavior3/5

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

Annotations already declare this is a non-read-only, non-destructive, closed-world mutation, so the safety bar is lower. The description adds real value by disclosing server-side validation (whole file must have arrived, size must not exceed the declared size) and that platform length limits are evaluated from the video meta before posting. It stays silent on repeat-call behaviour, such as whether a second call on the same link duplicates a Library item, which is a notable gap for a mutation tool.

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 lead sentence front-loads what the tool does and what it returns; error branches follow in compact form. The failure-mode sentences are dense and slightly telegraphic ('Nothing arrived yet:', 'Link ran out or wrong size:'), but each carries an actionable instruction rather than filler.

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

Completeness4/5

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

For a four-parameter, nested-object tool with an output schema, the description covers the workflow, validation and error recovery an agent needs to invoke it correctly. The only material omission is behaviour on repeated invocation of the same upload link.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, and the description earns one more by explaining why meta matters: duration, width and height feed each platform's length-limit check before posting. It also reinforces that path is the value begin_upload returned and that library_item_id is the handle for downstream calls.

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?

The description gives a specific verb and resource ('adds the file ... to the Library') and explicitly ties the tool to its predecessor postkey_begin_upload and its output library_item_id. An agent can distinguish it from postkey_begin_upload and postkey_attach_library_item without opening either 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?

It states precisely which state selects this tool (after a link is issued), names the follow-up consumers (postkey_attach_library_item, library_item_ids), and gives explicit recovery branches: resend to the same link if nothing arrived, restart with postkey_begin_upload if the link expired or the size mismatched. That is when-to-use plus alternatives, not inference.

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