Skip to main content
Glama

update_activity_schedule

Modify activity schedules in Adobe Target by specifying tenant, start, and end times in ISO 8601 format for precise time management.

Instructions

Update the activity schedule in Adobe Target.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endsAtYesThe end time of the activity in ISO 8601 format.
startsAtYesThe start time of the activity in ISO 8601 format.
tenantYesThe tenant identifier.

Implementation Reference

  • The main execution function for the 'update_activity_schedule' tool. It constructs a PUT request to the Adobe Target API endpoint for a specific activity (ID 168816) to update its schedule with provided start and end times.
    const executeFunction = async ({ tenant, startsAt, endsAt }) => { const baseUrl = 'https://mc.adobe.io'; const token = process.env.ADOBE_API_KEY; const apiKey = process.env.ADOBE_API_KEY; try { // Construct the URL for the request const url = `${baseUrl}/${tenant}/target/activities/ab/168816/schedule`; // Set up headers for the request const headers = { 'Authorization': `Bearer ${token}`, 'X-Api-Key': apiKey, 'Content-Type': 'application/vnd.adobe.target.v1+json' }; // Prepare the body of the request const body = JSON.stringify({ startsAt, endsAt }); // Perform the fetch request const response = await fetch(url, { method: 'PUT', headers, body }); // Check if the response was successful if (!response.ok) { const errorData = await response.json(); throw new Error(errorData); } // Parse and return the response data const data = await response.json(); return data; } catch (error) { console.error('Error updating activity schedule:', error); return { error: 'An error occurred while updating the activity schedule.' }; } };
  • The JSON schema definition for the tool, including name, description, input parameters (tenant, startsAt, endsAt), and required fields.
    type: 'function', function: { name: 'update_activity_schedule', description: 'Update the activity schedule in Adobe Target.', parameters: { type: 'object', properties: { tenant: { type: 'string', description: 'The tenant identifier.' }, startsAt: { type: 'string', description: 'The start time of the activity in ISO 8601 format.' }, endsAt: { type: 'string', description: 'The end time of the activity in ISO 8601 format.' } }, required: ['tenant', 'startsAt', 'endsAt'] } } }
  • lib/tools.js:7-16 (registration)
    Dynamic tool discovery and loading function that imports each tool file listed in toolPaths, extracts the apiTool object (including handler and schema), and returns the list of tools used by the MCP server.
    export async function discoverTools() { const toolPromises = toolPaths.map(async (file) => { const module = await import(`../tools/${file}`); return { ...module.apiTool, path: file, }; }); return Promise.all(toolPromises); }
  • mcpServer.js:102-103 (registration)
    In the MCP server startup, calls discoverTools() to load all tools (including update_activity_schedule) and passes the tools list to setupServerHandlers for registration with ListTools and CallTool request handlers.
    const tools = await discoverTools(); console.log("🧰 Tools discovered:", tools.map(t => t.definition?.function?.name));
  • The toolPaths array includes the relative path to the update-activity-schedule.js file, enabling its dynamic discovery and registration.
    'adobe/adobe-target-admin-ap-is/update-activity-schedule.js'

Other Tools

Related Tools

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/Amit-Lakhani/mcp1'

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