MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / registerAttachments

Method registerAttachments

internal/httpapi/attachments.go:160–170  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

158}
159
160func (s *Server) registerAttachments() {
161 huma.Register(s.API, huma.Operation{
162 OperationID: "getAttachment",
163 Method: http.MethodGet,
164 Path: "/v1/agents/{email}/messages/{id}/attachments/{index}",
165 Summary: "Get an attachment (metadata + short-lived download URL)",
166 Description: "Returns one attachment's metadata plus a short-lived `download_url` (+ `expires_at`) to fetch the bytes out of band — so binary content never streams through an agent's context. Pass `?inline=true` to also receive base64 `data` for small attachments (<= 256 KB); larger inline requests are rejected. `index` is the 0-based attachment index from the message's `attachments[]`.",
167 Tags: []string{"messages"},
168 Security: []map[string][]string{{"bearer": {}}},
169 }, s.handleGetAttachment)
170}
171
172func (s *Server) handleGetAttachment(ctx context.Context, in *attachmentParam) (*attachmentOutput, error) {
173 ag, err := s.resolveOwnedAgent(ctx, in.Address)

Callers 1

registerOperationsMethod · 0.95

Calls 1

RegisterMethod · 0.80

Tested by

no test coverage detected