Google · Capability

Google Gemini API — Content Generation

Google Gemini API — Content Generation. 3 operations. Lead operation: Google Count Tokens. Self-contained Naftiko capability covering one Google business surface.

Run with Naftiko GoogleContent Generation

What You Can Do

POST
Counttokens — Google Count Tokens
/v1/models/model-counttokens
POST
Generatecontent — Google Generate Content
/v1/models/model-generatecontent
POST
Streamgeneratecontent — Google Stream Generate Content
/v1/models/model-streamgeneratecontent

MCP Tools

google-count-tokens

Google Count Tokens

google-generate-content

Google Generate Content

google-stream-generate-content

Google Stream Generate Content

Capability Spec

gemini-content-generation.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Google Gemini API — Content Generation
  description: 'Google Gemini API — Content Generation. 3 operations. Lead operation: Google Count Tokens. Self-contained
    Naftiko capability covering one Google business surface.'
  tags:
  - Google
  - Content Generation
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    GOOGLE_API_KEY: GOOGLE_API_KEY
capability:
  consumes:
  - type: http
    namespace: gemini-content-generation
    baseUri: https://generativelanguage.googleapis.com/v1beta
    description: Google Gemini API — Content Generation business capability. Self-contained, no shared references.
    resources:
    - name: models-model}:countTokens
      path: /models/{model}:countTokens
      operations:
      - name: counttokens
        method: POST
        description: Google Count Tokens
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: model
          in: path
          type: string
          description: The model to use for token counting
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: models-model}:generateContent
      path: /models/{model}:generateContent
      operations:
      - name: generatecontent
        method: POST
        description: Google Generate Content
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: model
          in: path
          type: string
          description: The model to use for generation
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: models-model}:streamGenerateContent
      path: /models/{model}:streamGenerateContent
      operations:
      - name: streamgeneratecontent
        method: POST
        description: Google Stream Generate Content
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: model
          in: path
          type: string
          description: The model to use for generation
          required: true
        - name: alt
          in: query
          type: string
          description: Alternative response format
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    authentication:
      type: apikey
      key: x-goog-api-key
      value: '{{env.GOOGLE_API_KEY}}'
      placement: header
  exposes:
  - type: rest
    namespace: gemini-content-generation-rest
    port: 8080
    description: REST adapter for Google Gemini API — Content Generation. One Spectral-compliant resource per consumed operation,
      prefixed with /v1.
    resources:
    - path: /v1/models/model-counttokens
      name: models-model-counttokens
      description: REST surface for models-model}:countTokens.
      operations:
      - method: POST
        name: counttokens
        description: Google Count Tokens
        call: gemini-content-generation.counttokens
        with:
          model: rest.model
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/models/model-generatecontent
      name: models-model-generatecontent
      description: REST surface for models-model}:generateContent.
      operations:
      - method: POST
        name: generatecontent
        description: Google Generate Content
        call: gemini-content-generation.generatecontent
        with:
          model: rest.model
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/models/model-streamgeneratecontent
      name: models-model-streamgeneratecontent
      description: REST surface for models-model}:streamGenerateContent.
      operations:
      - method: POST
        name: streamgeneratecontent
        description: Google Stream Generate Content
        call: gemini-content-generation.streamgeneratecontent
        with:
          model: rest.model
          alt: rest.alt
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: gemini-content-generation-mcp
    port: 9090
    transport: http
    description: MCP adapter for Google Gemini API — Content Generation. One tool per consumed operation, routed inline through
      this capability's consumes block.
    tools:
    - name: google-count-tokens
      description: Google Count Tokens
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: gemini-content-generation.counttokens
      with:
        model: tools.model
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: google-generate-content
      description: Google Generate Content
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: gemini-content-generation.generatecontent
      with:
        model: tools.model
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: google-stream-generate-content
      description: Google Stream Generate Content
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: gemini-content-generation.streamgeneratecontent
      with:
        model: tools.model
        alt: tools.alt
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.