Skip to main content
Glama

fastly_api

Manage Fastly CDN services by making API requests to configure caching, security, and performance settings through authenticated endpoints.

Instructions

Make requests to the Fastly API. Allows accessing all endpoints of the Fastly API with custom paths, methods and parameters.

IMPORTANT USAGE NOTES FOR LLMs:

  1. When making multiple API calls, summarize the results between calls. The user doesn't see raw API responses.

  2. Base URL is automatically added - just provide the path (e.g. '/service').

  3. Authentication is handled automatically - no need to include API keys or know API keys.

  4. Common paths:

    • List services: GET /service

    • Get service details: GET /service/{service_id}

    • Get domains: GET /service/{service_id}/version/{version}/domain

    • Get backends: GET /service/{service_id}/version/{version}/backend

    • Purge cache: POST /service/{service_id}/purge_all

    • Get stats: GET /stats (with params: service_id, from, to)

  5. Always check status codes in responses. Status 200-299 indicates success.

  6. Include simple explanations of what you're doing and what the results mean before and after each API call.

Creating Fastly Compute@Edge Sites

To create a Compute@Edge site, you can use a combination of API calls and terminal commands. The API handles service creation and configuration, while terminal commands handle the local build and deployment process.

Follow these general steps:

  1. Create a new service using the API: POST /service with {"name": "My Site", "type": "wasm"}

  2. Initialize a local Compute project using the Fastly CLI

  3. Build the project using the appropriate build tools

  4. Deploy using the Fastly CLI with the service ID from step 1

COMMON PITFALLS TO AVOID:

  1. DO NOT use --name flag with fastly compute init (use interactive mode or -d -y flags instead)

  2. PowerShell requires semicolons (;) not ampersands (&&) for command chaining

  3. Fastly compute build creates the package archive AFTER you've built the Wasm binary

  4. Build is a TWO-STEP process: first compile to Wasm, then create the package archive

  5. Deploy command needs -d flag to avoid hanging on interactive prompts

  6. NEVER attempt to extract or use the user's API key directly - auth is handled by MCP

  7. To create a service from scratch, you must use API calls for configuration and CLI for local build

  8. Check current directory paths carefully before running commands

  9. Full URL paths aren't needed in API calls - just use the path portion (e.g. '/service')

See the full guide for detailed instructions on handling common errors and PowerShell-specific commands.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAPI path (e.g., '/service' or '/service/{service_id}/purge_all'). Don't include base URL.
methodYesHTTP method (GET, POST, PUT, DELETE)
bodyNoRequest body for POST/PUT requests (optional). Will be JSON-encoded automatically.
paramsNoURL parameters to add to the request (optional). For filtering, pagination, etc.
Behavior5/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 and excels at this. It explains authentication handling ('Authentication is handled automatically'), response handling ('summarize the results between calls'), status code interpretation ('Always check status codes'), and important constraints ('Base URL is automatically added', 'Full URL paths aren't needed'). It also provides detailed guidance about what the LLM should do before/after calls.

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 excessively long (over 500 words) with multiple sections that could be streamlined. While the front-loaded 'IMPORTANT USAGE NOTES' is well-structured, the later sections on 'Creating Fastly Compute@Edge Sites' and 'COMMON PITFALLS' contain information that belongs in documentation rather than a tool description. Many sentences don't directly help the agent select/invoke the tool.

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?

Given the complexity of a generic API tool with 4 parameters and no output schema, the description provides substantial context about usage patterns, common endpoints, authentication, and response handling. It covers most aspects needed for effective use, though it could benefit from more detail about error responses or rate limits. The absence of an output schema is partially compensated by guidance on interpreting status codes and summarizing results.

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 description coverage is 100%, so the baseline is 3. The description adds significant value beyond the schema by providing concrete examples of paths ('/service', '/service/{service_id}/purge_all'), explaining how parameters work ('with params: service_id, from, to'), and clarifying that the body is 'JSON-encoded automatically'. However, it doesn't fully explain all parameter nuances like how 'params' object maps to URL parameters.

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 tool 'Make requests to the Fastly API' with access to 'all endpoints', which is specific about the verb (make requests) and resource (Fastly API). It distinguishes from the sibling tool 'fastly_cli' by focusing on API calls rather than CLI commands. However, it doesn't explicitly contrast with the sibling tool beyond mentioning CLI in the usage notes.

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?

The description provides extensive usage guidance including explicit when-to-use scenarios (e.g., 'When making multiple API calls', 'To create a service from scratch'), alternatives (CLI for local build/deployment), and exclusions (e.g., 'NEVER attempt to extract or use the user's API key directly'). The 'IMPORTANT USAGE NOTES' section offers comprehensive context for when and how to use this tool versus other approaches.

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/jackwrichards/FastlyMCP'

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