Google · Capability

Google Gemini API — File Api

Google Gemini API — File Api. 2 operations. Lead operation: Google Upload File (Resumable). Self-contained Naftiko capability covering one Google business surface.

Run with Naftiko GoogleFile Api

What You Can Do

POST
Uploadfile — Google Upload File (Resumable)
/v1/files
GET
Getfile — Google Get File Metadata
/v1/files/{name}

MCP Tools

google-upload-file-resumable

Google Upload File (Resumable)

google-get-file-metadata

Google Get File Metadata

read-only idempotent

Capability Spec

gemini-file-api.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Google Gemini API — File Api
  description: 'Google Gemini API — File Api. 2 operations. Lead operation: Google Upload File (Resumable). Self-contained
    Naftiko capability covering one Google business surface.'
  tags:
  - Google
  - File Api
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    GOOGLE_API_KEY: GOOGLE_API_KEY
capability:
  consumes:
  - type: http
    namespace: gemini-file-api
    baseUri: https://generativelanguage.googleapis.com/v1beta
    description: Google Gemini API — File Api business capability. Self-contained, no shared references.
    resources:
    - name: files
      path: /files
      operations:
      - name: uploadfile
        method: POST
        description: Google Upload File (Resumable)
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: X-Goog-Upload-Protocol
          in: header
          type: string
          description: Upload protocol type
          required: true
        - name: X-Goog-Upload-Command
          in: header
          type: string
          description: Upload command (start for initiation, "upload, finalize" for data upload)
          required: true
        - name: X-Goog-Upload-Header-Content-Length
          in: header
          type: integer
          description: Total size of the file in bytes (required for start command)
        - name: X-Goog-Upload-Header-Content-Type
          in: header
          type: string
          description: MIME type of the file (required for start command)
        - name: X-Goog-Upload-Offset
          in: header
          type: integer
          description: Byte offset for upload (required for upload command)
        - name: Content-Length
          in: header
          type: integer
          description: Size of the current chunk being uploaded
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: files-name
      path: /files/{name}
      operations:
      - name: getfile
        method: GET
        description: Google Get File Metadata
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: name
          in: path
          type: string
          description: The resource name of the file (e.g., "files/abc123")
          required: true
    authentication:
      type: apikey
      key: x-goog-api-key
      value: '{{env.GOOGLE_API_KEY}}'
      placement: header
  exposes:
  - type: rest
    namespace: gemini-file-api-rest
    port: 8080
    description: REST adapter for Google Gemini API — File Api. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/files
      name: files
      description: REST surface for files.
      operations:
      - method: POST
        name: uploadfile
        description: Google Upload File (Resumable)
        call: gemini-file-api.uploadfile
        with:
          X-Goog-Upload-Protocol: rest.X-Goog-Upload-Protocol
          X-Goog-Upload-Command: rest.X-Goog-Upload-Command
          X-Goog-Upload-Header-Content-Length: rest.X-Goog-Upload-Header-Content-Length
          X-Goog-Upload-Header-Content-Type: rest.X-Goog-Upload-Header-Content-Type
          X-Goog-Upload-Offset: rest.X-Goog-Upload-Offset
          Content-Length: rest.Content-Length
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/files/{name}
      name: files-name
      description: REST surface for files-name.
      operations:
      - method: GET
        name: getfile
        description: Google Get File Metadata
        call: gemini-file-api.getfile
        with:
          name: rest.name
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: gemini-file-api-mcp
    port: 9090
    transport: http
    description: MCP adapter for Google Gemini API — File Api. One tool per consumed operation, routed inline through this
      capability's consumes block.
    tools:
    - name: google-upload-file-resumable
      description: Google Upload File (Resumable)
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: gemini-file-api.uploadfile
      with:
        X-Goog-Upload-Protocol: tools.X-Goog-Upload-Protocol
        X-Goog-Upload-Command: tools.X-Goog-Upload-Command
        X-Goog-Upload-Header-Content-Length: tools.X-Goog-Upload-Header-Content-Length
        X-Goog-Upload-Header-Content-Type: tools.X-Goog-Upload-Header-Content-Type
        X-Goog-Upload-Offset: tools.X-Goog-Upload-Offset
        Content-Length: tools.Content-Length
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: google-get-file-metadata
      description: Google Get File Metadata
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: gemini-file-api.getfile
      with:
        name: tools.name
      outputParameters:
      - type: object
        mapping: $.