Skip to main content
Glama

get_upload_urls

Get signed upload URLs for media files. Upload the file via PUT to the returned URL, then use the key in post creation.

Instructions

Get signed upload URLs for media files. Upload your file to the returned URL via PUT, then use the key in create_posts mediaItems.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentTypeYesMIME type of the file. Supported: image/jpeg, image/png, image/gif, image/webp, video/mp4, video/webm, video/quicktime
countNoNumber of upload URLs (1-8 for images, 1 for videos)

Implementation Reference

  • Registration and handler for the 'get_upload_urls' MCP tool. Calls POST /file/get-signed-upload-urls on the PostFast API and returns signed upload URLs.
    export function registerFileTools(server: McpServer, client: PostFastClient) {
      server.tool(
        'get_upload_urls',
        'Get signed upload URLs for media files. Upload your file to the returned URL via PUT, then use the key in create_posts mediaItems.',
        {
          contentType: z
            .string()
            .describe(
              `MIME type of the file. Supported: ${[...IMAGE_TYPES, ...VIDEO_TYPES].join(', ')}`,
            ),
          count: z
            .number()
            .int()
            .min(1)
            .max(8)
            .default(1)
            .describe('Number of upload URLs (1-8 for images, 1 for videos)'),
        },
        async (input) => {
          const data = await client.post<SignedUploadUrl[]>(
            '/file/get-signed-upload-urls',
            {
              contentType: input.contentType,
              count: input.count,
            },
          );
    
          return {
            content: [
              { type: 'text' as const, text: JSON.stringify(data, null, 2) },
            ],
          };
        },
      );
  • Input schema for get_upload_urls: contentType (MIME type) and count (1-8 for images, 1 for videos, defaults to 1).
    {
      contentType: z
        .string()
        .describe(
          `MIME type of the file. Supported: ${[...IMAGE_TYPES, ...VIDEO_TYPES].join(', ')}`,
        ),
      count: z
        .number()
        .int()
        .min(1)
        .max(8)
        .default(1)
        .describe('Number of upload URLs (1-8 for images, 1 for videos)'),
    },
  • src/index.ts:17-19 (registration)
    Tool registration entry point: registerFileTools is called from index.ts to register get_upload_urls on the MCP server.
    registerPostTools(server, client);
    registerAccountTools(server, client);
    registerFileTools(server, client);
  • SignedUploadUrl type definition used as the return type of get_upload_urls (key + signedUrl).
    export interface SignedUploadUrl {
      key: string;
      signedUrl: string;
    }
  • PostFastClient.post method used by get_upload_urls handler to make the API request.
    post<T>(path: string, body?: unknown): Promise<T> {
Behavior3/5

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

With no annotations provided, the description carries full burden. It explains that URLs are signed, that you upload via PUT, and that the key is used in create_posts. However, it does not disclose URL expiration, file size limits, or authentication requirements, leaving some behavioral gaps.

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?

Two sentences, zero fluff. Every word adds value—purpose, upload method, and integration with create_posts are all included efficiently.

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

Completeness3/5

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

For a simple tool with 2 parameters and no output schema, the description covers purpose and workflow but lacks details about the return format (e.g., structure of URLs, keys) and potential failure modes (e.g., rate limits, expiration). At 100% schema coverage and no output schema, additional context on return values would improve completeness.

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% (both contentType and count are described). The description adds no new semantic details about parameters beyond what the schema provides, though it does add workflow context (key usage). Baseline 3 is appropriate.

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 clearly states the verb 'Get' and the resource 'signed upload URLs for media files', making the purpose immediately obvious. It also mentions the subsequent use of the key in create_posts, which adds context.

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

Usage Guidelines3/5

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

The description implies a workflow (upload via PUT, then use key in create_posts) but does not explicitly state when to use or when not to use this tool compared to siblings like upload_media. No alternatives or exclusions are mentioned.

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/peturgeorgievv-factory/postfast-mcp'

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