Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

973 B
Raw Blame
import { createAction } from '@activepieces/pieces-framework';

import { tallyAuth } from '../auth';
import { tallyApiClient } from '../common/client';
import { workspacesDropdown } from '../common/props';
import { getWorkspaceActionOutputSchema } from '../output-schemas';

export const getWorkspaceAction = createAction({
	auth: tallyAuth,
	name: 'get_workspace',
	classification: 'READ',
	displayName: 'Get Workspace',
	description: 'Get a single workspace by id',
	audience: 'ai',
	outputSchema: getWorkspaceActionOutputSchema,
	aiMetadata: {
		description:
			'Fetches one workspace by id with its members, pending invites, and folders. Use List Workspaces first to resolve a workspace id. Read-only, safe to retry.',
		idempotent: true,
	},
	props: {
		workspace_id: workspacesDropdown,
	},
	async run(context) {
		const { auth, propsValue } = context;
		return tallyApiClient.getWorkspace({ apiKey: auth.secret_text, workspaceId: propsValue.workspace_id });
	},
});