@sierai/stargate
Version:
Stargate Tools for AI Agents.
28 lines (24 loc) • 928 B
text/typescript
import { z } from "zod";
import { StargateTool } from "@sierai/stargate-toolmaker";
import { Google } from "@sierai/stargate-auth";
const createGoogleDocs = new StargateTool({
name: "create_google_docs",
description:
"This tool will create a new Google Docs document. It requires the title and body of the document. After creating the document, it will return the document ID, give user the full url to the document.",
schema: z.object({
title: z.string().describe("Title of the document."),
body: z.string().describe("Body of the document."),
}),
runner: async (input, config, oauthProvider: InstanceType<typeof Google>) => {
try {
return await oauthProvider.createNewDocument({
title: input.title,
body: input.body,
});
return "Not authenticated.";
} catch (err) {
return "Error fetching events: " + err;
}
},
});
export default createGoogleDocs;