upload_attachment
Attach a file to a ServiceNow record from a local path, URL, or Base64 content, returning sha256 and size to verify the upload arrived intact.
Instructions
Attach a file to a ServiceNow record (requires WRITE_ENABLED=true). Provide ONE of: file_path (a file on the machine running NowAIKit, local server only), source_url (the server fetches it), or content_base64 (small files only). file_path and source_url never pass the file through this tool call, so prefer them for anything over ~20KB: a model can only write a limited amount of text in a single call. Returns sha256 and size_bytes of what was sent so you can confirm the attachment is intact.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"table": "<table>",
"record_sys_id": "<record_sys_id>"
},
"name": "upload_attachment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | Table name (e.g. "incident", "kb_knowledge") | |
| file_name | No | File name including extension (e.g. "screenshot.png"). Optional with file_path (defaults to the file's own name). | |
| file_path | No | Path to a file on the machine running NowAIKit (local stdio server: Claude Desktop, Claude Code, Cursor, etc.). Works on Windows, macOS and Linux: absolute paths (C:\Users\me\report.xlsx, /Users/me/report.xlsx), ~/ paths, file:// URLs, or paths relative to the server's working folder. Secrets (SSH/cloud keys, .env files, credential stores, MCP client configs) are always refused. Not available on remote/hosted servers. | |
| source_url | No | PREFERRED. http(s) URL the server fetches the file from and attaches directly. Use this for anything larger than a few hundred KB. Bytes never travel through this tool call. | |
| content_type | No | MIME type (e.g. "image/png", "application/pdf"). Optional when source_url is used (inferred from the response or file extension). | |
| record_sys_id | Yes | sys_id of the record to attach the file to | |
| content_base64 | No | Base64-encoded file content. Only for small files. Use source_url for anything larger. | |
| source_auth_header | No | Optional Authorization header value sent when fetching source_url (e.g. "Bearer <token>" or "Basic <creds>") for any protected URL that requires authentication. |