update_activity_priority
Modify the priority of an Adobe Target activity by specifying the tenant identifier and new priority value using the Postman MCP Generator's integration tool.
Instructions
Update the priority of an activity in Adobe Target.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| priority | Yes | The new priority value for the activity. | |
| tenant | Yes | The tenant identifier. |
Implementation Reference
- The core handler function `executeFunction` that executes the tool: constructs Adobe Target API URL with tenant and hardcoded activity ID, authenticates using API key and bearer token, sends PUT request with priority, handles response and errors.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.' }; } };
- Input schema definition specifying object with required string properties 'tenant' and 'priority'.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'] }
- The `apiTool` object that registers the tool by specifying its name 'update_activity_priority', description, schema, and linking to the handler function `executeFunction`. Exported for dynamic import.const apiTool = { function: executeFunction, 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'] } } } }; export { apiTool };
- tools/paths.js:1-5 (helper)Exports array of paths to tool files, including this one, used for dynamic tool discovery.export const toolPaths = [ 'adobe/adobe-target-admin-ap-is/update-activity-state.js', 'adobe/adobe-target-admin-ap-is/update-activity-priority.js', 'adobe/adobe-target-admin-ap-is/update-activity-schedule.js' ];
- lib/tools.js:7-16 (registration)Central `discoverTools` function that dynamically imports all tool modules from toolPaths, extracts each `apiTool`, adds path, and returns array of registered tools.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); }