@sisu-ai/tool-aws-s3
v2.0.6
Published
Work with AWS S3 from agents using safe tools for reading, listing, writing, and metadata access.
Maintainers
Readme
@sisu-ai/tool-aws-s3
Work with AWS S3 from agents using safe tools for reading, listing, writing, and metadata access.
Exports
s3GetObject({ bucket, key })→{ content: string }s3ListObjects({ bucket, prefix? })→string[]s3ListObjectsDetailed({ bucket, prefix? })→{ key: string; lastModified?: string; size?: number }[]s3GetObjectMetadata({ bucket, key })→Record<string, string>(user metadata)s3PutObject({ bucket, key, content })→{ ok: true } | { ok: false, error: string }s3DeleteObject({ bucket, key })→{ ok: true } | { ok: false, error: string }
Write operations are guarded. When disabled, write tools return { ok: false, error } (they do not throw).
Configuration
- Region:
AWS_REGIONorAWS_DEFAULT_REGION(defaults tous-east-1) - Credentials (optional):
AWS_ACCESS_KEY_ID+AWS_SECRET_ACCESS_KEYwhen set; otherwise it relies on the default credential chain - Optional client injection: Provide your own client via
ctx.state.s3.client(v3 S3Client or v2‑like shape withgetObject,listObjectsV2,putObject,deleteObject,headObject). - Write guard (default: disabled):
ctx.state.s3.allowWrite = true, orAWS_S3_ALLOW_WRITE=1.
Usage
import { Agent } from '@sisu-ai/core';
import { registerTools } from '@sisu-ai/mw-register-tools';
import { s3GetObject, s3ListObjectsDetailed, s3DeleteObject } from '@sisu-ai/tool-aws-s3';
const app = new Agent().use(registerTools([
s3GetObject, s3ListObjectsDetailed, s3DeleteObject
]));
// Optional: tweak write policy; region/creds read from env
ctx.state.s3 = { allowWrite: false };Env vars commonly used
AWS_REGIONorAWS_DEFAULT_REGIONAWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEY(optional if using instance/profile/role creds)AWS_S3_ALLOW_WRITE(set to1/trueto enable writes)
Read “latest” example
const items: any[] = await s3ListObjectsDetailed.handler({ bucket: 'my-bucket', prefix: 'folder/' } as any, ctx) as any;
const latest = items
.filter(i => i.lastModified)
.sort((a,b) => (a.lastModified! < b.lastModified! ? 1 : -1))[0]?.key;
if (latest) {
const { content } = await s3GetObject.handler({ bucket: 'my-bucket', key: latest } as any, ctx) as any;
// optionally delete
await s3DeleteObject.handler({ bucket: 'my-bucket', key: latest } as any, ctx);
}Community & Support
Discover what you can do through examples or documentation. Check it out at https://github.com/finger-gun/sisu. Example projects live under examples/ in the repo.
Documentation
Core — Package docs · Error types
Adapters — OpenAI · Anthropic · Ollama
- @sisu-ai/mw-agent-run-api
- @sisu-ai/mw-context-compressor
- @sisu-ai/mw-control-flow
- @sisu-ai/mw-conversation-buffer
- @sisu-ai/mw-cors
- @sisu-ai/mw-error-boundary
- @sisu-ai/mw-guardrails
- @sisu-ai/mw-invariants
- @sisu-ai/mw-orchestration
- @sisu-ai/mw-rag
- @sisu-ai/mw-react-parser
- @sisu-ai/mw-register-tools
- @sisu-ai/mw-tool-calling
- @sisu-ai/mw-trace-viewer
- @sisu-ai/mw-usage-tracker
- @sisu-ai/tool-aws-s3
- @sisu-ai/tool-azure-blob
- @sisu-ai/tool-extract-urls
- @sisu-ai/tool-github-projects
- @sisu-ai/tool-rag
- @sisu-ai/tool-summarize-text
- @sisu-ai/tool-terminal
- @sisu-ai/tool-web-fetch
- @sisu-ai/tool-web-search-duckduckgo
- @sisu-ai/tool-web-search-google
- @sisu-ai/tool-web-search-openai
- @sisu-ai/tool-wikipedia
Anthropic — hello · control-flow · stream · weather
Ollama — hello · stream · vision · weather · web-search
OpenAI — hello · weather · stream · vision · reasoning · react · control-flow · branch · parallel · graph · orchestration · orchestration-adaptive · guardrails · error-handling · rag-chroma · web-search · web-fetch · wikipedia · terminal · github-projects · server · aws-s3 · azure-blob
Contributing
We build Sisu in the open. Contributions welcome.
Contributing Guide · Report a Bug · Request a Feature · Code of Conduct
Star on GitHub if Sisu helps you build better agents.
Quiet, determined, relentlessly useful.
