update_activity_priority
Modify priority levels for Adobe Target activities to control execution order and resource allocation. Specify tenant and new priority values to adjust activity sequencing.
Instructions
Update the priority of an activity in Adobe Target.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tenant | Yes | The tenant identifier. | |
| priority | Yes | The new priority value for the activity. |
Implementation Reference
- The main handler function that executes the tool logic by making a PUT request to the Adobe Target API to update the priority of activity ID 168816.const executeFunction = async ({ tenant, priority }) => { 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/priority`; // 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 data for the request const body = JSON.stringify({ priority }); // 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 priority:', error); return { error: 'An error occurred while updating activity priority.' }; } };
- The JSON schema definition for the tool, including parameters for tenant and priority.definition: { type: 'function', function: { name: 'update_activity_priority', description: 'Update the priority of an activity in Adobe Target.', parameters: { type: 'object', properties: { tenant: { type: 'string', description: 'The tenant identifier.' }, priority: { type: 'string', description: 'The new priority value for the activity.' } }, required: ['tenant', 'priority'] } } }
- lib/tools.js:7-16 (registration)Dynamic registration of the tool via discoverTools, which imports apiTool from the tool's file path.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); }
- tools/paths.js:3-3 (registration)The toolPaths array entry listing the file path for the update_activity_priority tool.'adobe/adobe-target-admin-ap-is/update-activity-priority.js',