Skip to main content
Glama

download_icon_by_id

Download icons from Freepik by their unique ID in various formats and sizes for integration into projects.

Instructions

Download the specified icon by its unique ID in the requested format and size.

Path Parameters:

  • id (Required): Icon resource ID

Query Parameters:

  • format: These are the formats available for download

  • Note: gif, mp4, aep, json, psd and eps are not available for standard and sticker icon types.

  • png_size: These are the sizes available for png_url formats.

  • Note: Only apply to format png.

Responses:

  • 200 (Success): OK

    • Content-Type: application/json

    • Response Properties:

    • Example:

{
  "data": {
    "filename": "filename",
    "url": "https://openapi-generator.tech"
  }
}
  • 400: Bad Request - The server could not understand the request due to invalid syntax.

    • Content-Type: application/json

    • Response Properties:

    • Example:

{
  "message": "message"
}
  • 401: Unauthorized - The client must authenticate itself to get the requested response.

    • Content-Type: application/json

    • Response Properties:

    • Example:

{
  "message": "message"
}
  • 403: Forbidden - The client does not have permission to access the requested resource.

    • Content-Type: application/json

    • Response Properties:

    • Example:

{
  "message": "message"
}
  • 404: Not Found - The server can not find the requested resource.

    • Content-Type: application/json

    • Response Properties:

    • Example:

{
  "message": "message"
}
  • 429: Too Many Requests - The client has sent too many requests in a given amount of time.

    • Content-Type: application/json

    • Response Properties:

    • Example:

{
  "message": "message"
}
  • 500: Internal Server Error - The server has encountered a situation it doesn't know how to handle.

    • Content-Type: application/json

    • Response Properties:

    • Example:

{
  "message": "Internal Server Error"
}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
Accept-LanguageNoSpecifies the search query language using the ISO 639-1 (2-letter language code) and the ISO 3166-1 (2-letter country code) for language variants. The API will use "en-US" as a default language for processing if a code is not provided, or does not exist.
idYesIcon resource ID
formatNoThese are the formats available for download - Note: gif, mp4, aep, json, psd and eps are not available for standard and sticker icon types.
png_sizeNoThese are the sizes available for png_url formats. - Note: Only apply to format png.

Implementation Reference

  • Registers all GET/POST endpoints matching /v1/icon.* as MCP tools. This exposes the Icons API, including the download_icon_by_id tool generated from the OpenAPI specification.
    RouteMap(
        methods=[
            "GET",
            "POST",
        ],
        pattern=r"/v1/icon.*",
        mcp_type=MCPType.TOOL,
    ),
  • Instantiates the FastMCP server from the loaded OpenAPI spec and route maps, automatically generating and registering tools (including download_icon_by_id) that proxy requests to the Freepik API via the configured HTTP client.
    server = FastMCP.from_openapi(
        openapi_spec=openapi_spec,
        client=http_client,
        name=server_config.name,
        route_maps=route_maps,
        mcp_component_fn=mcp_component_fn,
    )
  • Loads the OpenAPI specification used to generate tool schemas and handlers for the Icons API endpoints.
    spec_loader = OpenApiSpecLoader(cache_config)
    openapi_spec = spec_loader.load_spec()
Behavior3/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 adds some context beyond basic purpose, such as format restrictions for certain icon types and size applicability for PNG, but lacks details on authentication needs, rate limits, or what the download entails (e.g., file retrieval vs. metadata). No contradiction with annotations exists.

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

Conciseness2/5

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

The description is overly verbose and poorly structured, including extensive HTTP response details that are not needed for an AI agent. It mixes tool description with API documentation, making it front-loaded with useful info but cluttered with redundant sections like full error examples, which reduces clarity and efficiency.

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?

Given no annotations and no output schema, the description partially compensates by including format/size constraints and response examples, but it's incomplete for a download tool. It misses key behavioral aspects like authentication requirements or download mechanics, and the verbose structure detracts from providing a clear, complete overview.

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 all parameters thoroughly. The description adds minimal value beyond the schema, such as repeating format and size notes, but doesn't provide additional semantic context like usage examples or edge cases. Baseline 3 is appropriate given high schema coverage.

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 tool's purpose with specific verb ('Download') and resource ('icon by its unique ID'), and distinguishes it from siblings like 'get_icon_detail_by_id' (which retrieves metadata) and 'download_resource_by_id' (which downloads resources, not specifically icons). The mention of 'requested format and size' further specifies the action.

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 explicit guidance on when to use this tool versus alternatives is provided. While the purpose implies it's for downloading icons, it doesn't differentiate from 'download_resource_by_id' or explain when to choose one over the other. The description lacks context about prerequisites or typical use cases.

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/freepik-company/freepik-mcp'

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