openapi: 3.0.3
info:
title: Google Apps Script API (mcpist subset)
description: Subset of Google Apps Script API v1 used by mcpist google_apps_script module
version: "v1"
servers:
- url: https://script.googleapis.com/v1
security:
- bearerAuth: []
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
schemas:
# ============ Project ============
Project:
type: object
properties:
scriptId:
type: string
title:
type: string
parentId:
type: string
createTime:
type: string
updateTime:
type: string
creator:
$ref: '#/components/schemas/GoogleUser'
lastModifyUser:
$ref: '#/components/schemas/GoogleUser'
GoogleUser:
type: object
properties:
domain:
type: string
email:
type: string
name:
type: string
photoUrl:
type: string
CreateProjectRequest:
type: object
required: [title]
properties:
title:
type: string
parentId:
type: string
# ============ Content ============
Content:
type: object
properties:
scriptId:
type: string
files:
type: array
items:
$ref: '#/components/schemas/ScriptFile'
ScriptFile:
type: object
properties:
name:
type: string
type:
type: string
description: "SERVER_JS, HTML, or JSON"
source:
type: string
createTime:
type: string
updateTime:
type: string
lastModifyUser:
$ref: '#/components/schemas/GoogleUser'
functionSet:
type: object
additionalProperties: true
UpdateContentRequest:
type: object
required: [files]
properties:
files:
type: array
items:
$ref: '#/components/schemas/ScriptFileInput'
ScriptFileInput:
type: object
properties:
name:
type: string
type:
type: string
source:
type: string
# ============ Version ============
Version:
type: object
properties:
versionNumber:
type: integer
description:
type: string
createTime:
type: string
scriptId:
type: string
VersionList:
type: object
properties:
versions:
type: array
items:
$ref: '#/components/schemas/Version'
nextPageToken:
type: string
CreateVersionRequest:
type: object
properties:
description:
type: string
# ============ Deployment ============
Deployment:
type: object
properties:
deploymentId:
type: string
deploymentConfig:
$ref: '#/components/schemas/DeploymentConfig'
updateTime:
type: string
entryPoints:
type: array
items:
type: object
additionalProperties: true
DeploymentConfig:
type: object
properties:
scriptId:
type: string
versionNumber:
type: integer
manifestFileName:
type: string
description:
type: string
DeploymentList:
type: object
properties:
deployments:
type: array
items:
$ref: '#/components/schemas/Deployment'
nextPageToken:
type: string
CreateDeploymentRequest:
type: object
required: [versionNumber]
properties:
versionNumber:
type: integer
description:
type: string
manifestFileName:
type: string
UpdateDeploymentRequest:
type: object
properties:
deploymentConfig:
$ref: '#/components/schemas/DeploymentConfig'
# ============ Execution ============
ExecutionRequest:
type: object
required: [function]
properties:
function:
type: string
parameters:
type: array
items: {}
devMode:
type: boolean
ExecutionResponse:
type: object
properties:
done:
type: boolean
response:
type: object
additionalProperties: true
error:
type: object
additionalProperties: true
# ============ Process ============
Process:
type: object
properties:
processId:
type: string
functionName:
type: string
processType:
type: string
processStatus:
type: string
startTime:
type: string
duration:
type: string
userAccessLevel:
type: string
projectName:
type: string
executingUser:
type: string
ProcessList:
type: object
properties:
processes:
type: array
items:
$ref: '#/components/schemas/Process'
nextPageToken:
type: string
# ============ Metrics ============
Metrics:
type: object
properties:
activeUsers:
type: array
items:
$ref: '#/components/schemas/MetricsValue'
totalExecutions:
type: array
items:
$ref: '#/components/schemas/MetricsValue'
failedExecutions:
type: array
items:
$ref: '#/components/schemas/MetricsValue'
MetricsValue:
type: object
properties:
startTime:
type: string
endTime:
type: string
value:
type: string
paths:
# =========================================================================
# Projects
# =========================================================================
/projects:
post:
operationId: createProject
summary: Create a new standalone script project
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateProjectRequest'
responses:
'200':
description: Created project
content:
application/json:
schema:
$ref: '#/components/schemas/Project'
/projects/{scriptId}:
get:
operationId: getProject
summary: Get a script project metadata
parameters:
- name: scriptId
in: path
required: true
schema:
type: string
responses:
'200':
description: Project metadata
content:
application/json:
schema:
$ref: '#/components/schemas/Project'
/projects/{scriptId}/content:
get:
operationId: getContent
summary: Get the content of a script project
parameters:
- name: scriptId
in: path
required: true
schema:
type: string
- name: versionNumber
in: query
schema:
type: integer
responses:
'200':
description: Project content
content:
application/json:
schema:
$ref: '#/components/schemas/Content'
put:
operationId: updateContent
summary: Update the content of a script project
parameters:
- name: scriptId
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateContentRequest'
responses:
'200':
description: Updated content
content:
application/json:
schema:
$ref: '#/components/schemas/Content'
# =========================================================================
# Versions
# =========================================================================
/projects/{scriptId}/versions:
get:
operationId: listVersions
summary: List versions of a script project
parameters:
- name: scriptId
in: path
required: true
schema:
type: string
- name: pageSize
in: query
schema:
type: integer
- name: pageToken
in: query
schema:
type: string
responses:
'200':
description: List of versions
content:
application/json:
schema:
$ref: '#/components/schemas/VersionList'
post:
operationId: createVersion
summary: Create a new version
parameters:
- name: scriptId
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateVersionRequest'
responses:
'200':
description: Created version
content:
application/json:
schema:
$ref: '#/components/schemas/Version'
/projects/{scriptId}/versions/{versionNumber}:
get:
operationId: getVersion
summary: Get a specific version
parameters:
- name: scriptId
in: path
required: true
schema:
type: string
- name: versionNumber
in: path
required: true
schema:
type: integer
responses:
'200':
description: Version details
content:
application/json:
schema:
$ref: '#/components/schemas/Version'
# =========================================================================
# Deployments
# =========================================================================
/projects/{scriptId}/deployments:
get:
operationId: listDeployments
summary: List deployments
parameters:
- name: scriptId
in: path
required: true
schema:
type: string
- name: pageSize
in: query
schema:
type: integer
- name: pageToken
in: query
schema:
type: string
responses:
'200':
description: List of deployments
content:
application/json:
schema:
$ref: '#/components/schemas/DeploymentList'
post:
operationId: createDeployment
summary: Create a deployment
parameters:
- name: scriptId
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateDeploymentRequest'
responses:
'200':
description: Created deployment
content:
application/json:
schema:
$ref: '#/components/schemas/Deployment'
/projects/{scriptId}/deployments/{deploymentId}:
get:
operationId: getDeployment
summary: Get deployment details
parameters:
- name: scriptId
in: path
required: true
schema:
type: string
- name: deploymentId
in: path
required: true
schema:
type: string
responses:
'200':
description: Deployment details
content:
application/json:
schema:
$ref: '#/components/schemas/Deployment'
put:
operationId: updateDeployment
summary: Update a deployment
parameters:
- name: scriptId
in: path
required: true
schema:
type: string
- name: deploymentId
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateDeploymentRequest'
responses:
'200':
description: Updated deployment
content:
application/json:
schema:
$ref: '#/components/schemas/Deployment'
delete:
operationId: deleteDeployment
summary: Delete a deployment
parameters:
- name: scriptId
in: path
required: true
schema:
type: string
- name: deploymentId
in: path
required: true
schema:
type: string
responses:
'204':
description: Deployment deleted
# =========================================================================
# Execution (scripts/:run uses colon path)
# =========================================================================
/scripts/{scriptId}:run:
post:
operationId: runScript
summary: Run a function in a script project
parameters:
- name: scriptId
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ExecutionRequest'
responses:
'200':
description: Execution result
content:
application/json:
schema:
$ref: '#/components/schemas/ExecutionResponse'
# =========================================================================
# Processes
# =========================================================================
/processes:
get:
operationId: listProcesses
summary: List user processes
parameters:
- name: pageSize
in: query
schema:
type: integer
- name: pageToken
in: query
schema:
type: string
- name: userProcessFilter.scriptId
in: query
schema:
type: string
- name: userProcessFilter.functionName
in: query
schema:
type: string
- name: userProcessFilter.statuses
in: query
schema:
type: array
items:
type: string
style: form
explode: true
- name: userProcessFilter.types
in: query
schema:
type: array
items:
type: string
style: form
explode: true
responses:
'200':
description: List of processes
content:
application/json:
schema:
$ref: '#/components/schemas/ProcessList'
/processes:listScriptProcesses:
get:
operationId: listScriptProcesses
summary: List script processes (executions)
parameters:
- name: scriptId
in: query
required: true
schema:
type: string
- name: pageSize
in: query
schema:
type: integer
- name: pageToken
in: query
schema:
type: string
- name: scriptProcessFilter.functionName
in: query
schema:
type: string
responses:
'200':
description: List of script processes
content:
application/json:
schema:
$ref: '#/components/schemas/ProcessList'
# =========================================================================
# Metrics
# =========================================================================
/projects/{scriptId}/metrics:
get:
operationId: getMetrics
summary: Get execution metrics
parameters:
- name: scriptId
in: path
required: true
schema:
type: string
- name: metricsGranularity
in: query
required: true
schema:
type: string
enum: [WEEKLY, DAILY]
- name: metricsFilter.deploymentId
in: query
schema:
type: string
responses:
'200':
description: Metrics data
content:
application/json:
schema:
$ref: '#/components/schemas/Metrics'