generate_signed_url
Create secure, time-limited CDN URLs for images with HMAC-SHA256 signing and optional transformation parameters to control access and delivery.
Instructions
Generate an HMAC-SHA256 signed CDN URL. Requires signing to be enabled.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | No | Project ID (UUID). If omitted, uses SPRONTA_PROJECT_ID env var. | |
| path | Yes | Image path (e.g. /my-project/hero.jpg) | |
| params | No | Transform params as key-value strings (e.g. {w: '800'}) | |
| expiresIn | No | Expiration in seconds (60–604800) |
Implementation Reference
- src/index.ts:247-256 (handler)The handler for "generate_signed_url" which makes a PUT request to the signing endpoint.
case "generate_signed_url": { const pid = getProjectId(args); return ok( await api.request("PUT", `/images/projects/${pid}/signing`, { path: args.path, params: args.params, expiresIn: args.expiresIn, }), ); } - src/tools.ts:302-325 (schema)The tool registration schema for "generate_signed_url".
{ name: "generate_signed_url", description: "Generate an HMAC-SHA256 signed CDN URL. Requires signing to be enabled.", inputSchema: { type: "object", properties: { ...projectIdParam, path: { type: "string", description: "Image path (e.g. /my-project/hero.jpg)", }, params: { type: "object", additionalProperties: { type: "string" }, description: "Transform params as key-value strings (e.g. {w: '800'})", }, expiresIn: { type: "integer", description: "Expiration in seconds (60–604800)", }, }, required: ["path"], }, },