{
  "service": "writer",
  "displayName": "Writer",
  "categories": [
    "AI",
    "Developer Tools"
  ],
  "authTypes": [
    "api_key"
  ],
  "auth": [
    {
      "type": "api_key",
      "label": "API Key",
      "placeholder": "WRITER_API_KEY",
      "description": "Writer API key used with the Authorization Bearer header. Create it in AI Studio Admin Settings > API Keys."
    }
  ],
  "homepageUrl": "https://writer.com",
  "actions": [
    {
      "id": "writer.create_chat_completion",
      "service": "writer",
      "name": "create_chat_completion",
      "description": "Generate a non-streaming Writer chat completion from plain-text conversation messages.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "minLength": 1,
            "description": "The Writer model identifier to use for the chat completion."
          },
          "messages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "role": {
                  "type": "string",
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "description": "The role of the chat message author."
                },
                "content": {
                  "type": "string",
                  "description": "The plain-text content of the message."
                },
                "name": {
                  "type": "string",
                  "description": "An optional name for the message sender."
                }
              },
              "additionalProperties": false,
              "required": [
                "role",
                "content"
              ],
              "description": "A plain-text chat message sent to Writer."
            },
            "description": "The ordered plain-text conversation messages.",
            "minItems": 1
          },
          "max_tokens": {
            "type": "integer",
            "minimum": 1,
            "description": "The maximum number of tokens to generate."
          },
          "temperature": {
            "type": "number",
            "description": "The sampling temperature for generation."
          },
          "top_p": {
            "type": "number",
            "description": "The nucleus sampling threshold."
          },
          "n": {
            "type": "integer",
            "minimum": 1,
            "description": "The number of completions to generate for the prompt."
          },
          "stop": {
            "anyOf": [
              {
                "type": "string",
                "description": "A single stop sequence."
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "description": "A stop sequence."
                },
                "description": "A list of stop sequences."
              }
            ],
            "description": "One or more stop sequences that end generation."
          },
          "logprobs": {
            "type": "boolean",
            "description": "Whether to return log probabilities for output tokens."
          },
          "stream": {
            "const": false,
            "type": "boolean",
            "description": "Whether to stream the response. Connector actions only accept false or an omitted value."
          },
          "response_format": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "text",
                  "json_schema"
                ],
                "description": "The response format type."
              },
              "json_schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "The JSON Schema object used when type is json_schema."
              }
            },
            "additionalProperties": false,
            "required": [
              "type"
            ],
            "description": "The requested response format for the chat completion.",
            "if": {
              "properties": {
                "type": {
                  "const": "json_schema"
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "required": [
                "json_schema"
              ]
            }
          }
        },
        "additionalProperties": false,
        "required": [
          "model",
          "messages"
        ],
        "description": "Input parameters for creating a Writer chat completion."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The Writer chat completion identifier."
          },
          "object": {
            "type": "string",
            "description": "The object type returned by Writer."
          },
          "choices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer",
                  "description": "The index of the completion choice."
                },
                "finish_reason": {
                  "type": "string",
                  "description": "The reason why Writer stopped generating this choice."
                },
                "message": {
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "description": "The role associated with the generated message."
                    },
                    "content": {
                      "anyOf": [
                        {
                          "type": "string",
                          "description": "The generated text content."
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "refusal": {
                      "anyOf": [
                        {
                          "type": "string",
                          "description": "The refusal text when content was refused."
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "tool_calls": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "description": "A Writer tool call object."
                      },
                      "description": "Tool calls returned by Writer when tool calling is used through the API."
                    }
                  },
                  "additionalProperties": true,
                  "description": "The Writer assistant message."
                }
              },
              "additionalProperties": true,
              "description": "A single Writer chat completion choice."
            },
            "description": "The generated completion choices.",
            "minItems": 1
          },
          "created": {
            "type": "integer",
            "description": "The Unix timestamp when the response was created."
          },
          "model": {
            "type": "string",
            "description": "The Writer model that generated the response."
          },
          "usage": {
            "type": "object",
            "properties": {
              "prompt_tokens": {
                "type": "integer",
                "description": "The number of prompt tokens consumed."
              },
              "completion_tokens": {
                "type": "integer",
                "description": "The number of completion tokens generated."
              },
              "total_tokens": {
                "type": "integer",
                "description": "The total number of tokens consumed."
              }
            },
            "additionalProperties": true,
            "description": "Token usage metadata for the Writer chat completion."
          },
          "system_fingerprint": {
            "type": "string",
            "description": "The Writer system fingerprint for the response."
          },
          "service_tier": {
            "type": "string",
            "description": "The Writer service tier used for the response."
          }
        },
        "additionalProperties": true,
        "required": [
          "id",
          "object",
          "choices",
          "created",
          "model"
        ],
        "description": "The response payload for a Writer chat completion."
      }
    },
    {
      "id": "writer.list_models",
      "service": "writer",
      "name": "list_models",
      "description": "Retrieve the Writer models available for text generation, chat completions, and other AI tasks.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {},
        "additionalProperties": false,
        "description": "No input parameters are required for this action."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "models": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "The Writer model identifier."
                },
                "name": {
                  "type": "string",
                  "description": "The display name of the Writer model."
                }
              },
              "additionalProperties": false,
              "required": [
                "id",
                "name"
              ],
              "description": "A Writer model entry."
            },
            "description": "The Writer models available to the API key."
          }
        },
        "additionalProperties": false,
        "required": [
          "models"
        ],
        "description": "The response payload for listing Writer models."
      }
    }
  ]
}
