Skip to main content
Glama
create-agent.ts1.46 kB
import { createAction, Property } from '@activepieces/pieces-framework'; import { customgptAuth } from '../common/auth'; import { makeRequest } from '../common/client'; import { HttpMethod } from '@activepieces/pieces-common'; export const createAgent = createAction({ auth: customgptAuth, name: 'createAgent', displayName: 'Create Agent', description: 'Create a new CustomGPT agent by importing data from a sitemap or file', props: { project_name: Property.ShortText({ displayName: 'Project Name', description: 'The name for your agent/project', required: true, }), sitemap_path: Property.ShortText({ displayName: 'Sitemap URL', description: 'URL to a sitemap for importing agent knowledge (leave empty if uploading a file)', required: false, }), file: Property.File({ displayName: 'File', description: 'Upload a file (text, audio, or video format) for agent knowledge (leave empty if using sitemap)', required: false, }), }, async run(context) { const { project_name, sitemap_path, file } = context.propsValue; const body: any = { project_name, }; if (sitemap_path) { body.sitemap_path = sitemap_path; } if (file) { body.file = file; } const response = await makeRequest( context.auth.secret_text, HttpMethod.POST, '/projects', body ); return response; }, });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/activepieces/activepieces'

If you have feedback or need assistance with the MCP directory API, please join our Discord server