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
TypeScript ai-agentai-agent-toolsai-agentsai-agents-frameworkmcpmcp-servermcp-toolsmcpsn8n-alternativeno-code-automationworkflowworkflow-automationworkflows
import { Property, createAction } from '@activepieces/pieces-framework';
import { spotifyCommon, makeClient } from '../common';
export default createAction({
name: 'get_saved_tracks',
classification: 'SEARCH',
displayName: 'Get Saved Tracks',
description: 'Retrieves the list of saved tracks for the current user',
audience: 'both',
aiMetadata: {
description: "Lists the tracks in the current user's Liked Songs library. By default returns one paged page (limit/offset); enable the All option to auto-page through and return every saved track in one call. Read-only and repeatable.",
idempotent: true,
},
auth: spotifyCommon.authentication,
props: {
offset: Property.Number({
displayName: 'Offset',
required: false,
}),
limit: Property.Number({
displayName: 'Limit',
required: false,
}),
all: Property.Checkbox({
displayName: 'All',
description: 'Fetches all items in a single request',
required: false,
}),
},
async run({ auth, propsValue }) {
const client = makeClient({ auth });
if (propsValue.all) {
const items = await client.getAllSavedTracks();
return { total: items.length, items };
}
return await client.getSavedTracks({
limit: propsValue.limit,
offset: propsValue.offset,
});
},
});