| … | … | @@ -0,0 +1,73 @@ | |
| 34 | + | export const AttachmentUploadTool = Tool.make("t3_attachment_prepare_upload", { | |
| 35 | + | ...shared, | |
| 36 | + | description: | |
| 37 | + | "Create the app's signed upload URL. PUT the exact bytes to relativeUrl on this MCP server's HTTP origin, then pass the attachment metadata and returned ID to t3_thread_send_attachments. Upload is separate from sending; provider attachment support is decided by its adapter.", | |
🟠 High attachment/tools.ts:37
Following the PUT instruction in this description reaches no handler because attachmentUploadRouteLayer only registers POST for the returned upload URL. The staged file is therefore never uploaded, so the subsequent t3_thread_send_attachments call cannot send it; register a PUT handler or change the contract to match the route.
Also found in 1 other location(s)
apps/server/src/mcp/McpHttpServer.ts:277
Registering
AttachmentRegistrationLiveexposest3_attachment_prepare_upload, whose tool description directs clients toPUTthe upload bytes, butattachmentUploadRouteLayeris registered only forPOSTat that URL. A client following the newly exposed tool contract therefore cannot upload the staged file and cannot subsequently send the attachment.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
| 1 | In file @apps/server/src/mcp/toolkits/attachment/tools.ts around line 37: |
| 2 | |
| 3 | Following the `PUT` instruction in this description reaches no handler because `attachmentUploadRouteLayer` only registers `POST` for the returned upload URL. The staged file is therefore never uploaded, so the subsequent `t3_thread_send_attachments` call cannot send it; register a `PUT` handler or change the contract to match the route. |
| 4 | |
| 5 | Also found in 1 other location(s): |
| 6 | - apps/server/src/mcp/McpHttpServer.ts:277 -- Registering `AttachmentRegistrationLive` exposes `t3_attachment_prepare_upload`, whose tool description directs clients to `PUT` the upload bytes, but `attachmentUploadRouteLayer` is registered only for `POST` at that URL. A client following the newly exposed tool contract therefore cannot upload the staged file and cannot subsequently send the attachment. |
Fixed in bf8195852e913b0cefd21d9e2510d942de8066c7. The tool now says POST, matching attachmentUploadRouteLayer in apps/server/src/http.ts:402-404. The existing route consumes the raw request stream and returns 204 on successful storage; no new route or service behavior was needed. Targeted formatting/diff check, the shared core MCP tests (3/3), and canonical server typecheck pass.