Skip to main content
Glama
Ucode-io

Postman MCP Generator

by Ucode-io

delete_data

Remove entity data from the Ucode Items API by specifying the identifier. Simplified deletion process integrated into the Postman MCP Generator for streamlined API interactions.

Instructions

Delete data from the Ucode Items API.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe identifier of the entity to be deleted.

Implementation Reference

  • The core handler function `executeFunction` that sends a DELETE HTTP request to the Ucode Items API to delete the entity identified by `id`.
    const executeFunction = async ({ id }) => {
      const baseUrl = 'https://postman-rest-api-learner.glitch.me/';
      const token = process.env.UCODE_PUBLIC_APIS_API_KEY;
      try {
        // Construct the URL with query parameters
        const url = new URL(`${baseUrl}/info`);
        url.searchParams.append('id', id);
    
        // Set up headers for the request
        const headers = {
          'Content-Type': 'application/json'
        };
    
        // Perform the fetch request
        const response = await fetch(url.toString(), {
          method: 'DELETE',
          headers
        });
    
        // Check if the response was successful
        if (!response.ok) {
          const errorData = await response.json();
          throw new Error(errorData);
        }
    
        // Return success message or response
        return { message: 'Data deleted successfully', status: response.status };
      } catch (error) {
        console.error('Error deleting data:', error);
        return { error: 'An error occurred while deleting data.' };
      }
    };
  • The `apiTool` object defining the tool's schema, including name 'delete_data', description, and input parameters schema requiring a string 'id'.
    const apiTool = {
      function: executeFunction,
      definition: {
        type: 'function',
        function: {
          name: 'delete_data',
          description: 'Delete data from the Ucode Items API.',
          parameters: {
            type: 'object',
            properties: {
              id: {
                type: 'string',
                description: 'The identifier of the entity to be deleted.'
              }
            },
            required: ['id']
          }
        }
      }
    };
  • tools/paths.js:1-6 (registration)
    The list of tool file paths that includes the delete-data.js file, enabling its discovery.
    export const toolPaths = [
      'ucode-public-apis/ucode-items-ap-is/post-data.js',
      'ucode-public-apis/ucode-items-ap-is/get-data.js',
      'ucode-public-apis/ucode-items-ap-is/delete-data.js',
      'ucode-public-apis/ucode-items-ap-is/update-data.js'
    ];
  • lib/tools.js:7-16 (registration)
    The `discoverTools` function that loads the `apiTool` from delete-data.js (via paths) 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:82-160 (registration)
    In the MCP server startup, calls `discoverTools()` to load tools including 'delete_data' and passes them to `setupServerHandlers` to register ListTools and CallTool handlers.
    async function run() {
      const args = process.argv.slice(2);
      const isSSE = args.includes("--sse");
      const tools = await discoverTools();
    
      if (isSSE) {
        const app = express();
        const transports = {};
        const servers = {};
    
        app.get("/sse", async (_req, res) => {
          // Create a new Server instance for each session
          const server = new Server(
            {
              name: SERVER_NAME,
              version: "0.1.0",
            },
            {
              capabilities: {
                tools: {},
              },
            }
          );
          server.onerror = (error) => console.error("[Error]", error);
          await setupServerHandlers(server, tools);
    
          const transport = new SSEServerTransport("/messages", res);
          transports[transport.sessionId] = transport;
          servers[transport.sessionId] = server;
    
          res.on("close", async () => {
            delete transports[transport.sessionId];
            await server.close();
            delete servers[transport.sessionId];
          });
    
          await server.connect(transport);
        });
    
        app.post("/messages", async (req, res) => {
          const sessionId = req.query.sessionId;
          const transport = transports[sessionId];
          const server = servers[sessionId];
    
          if (transport && server) {
            await transport.handlePostMessage(req, res);
          } else {
            res.status(400).send("No transport/server found for sessionId");
          }
        });
    
        const port = process.env.PORT || 3001;
        app.listen(port, () => {
          console.log(`[SSE Server] running on port ${port}`);
        });
      } else {
        // stdio mode: single server instance
        const server = new Server(
          {
            name: SERVER_NAME,
            version: "0.1.0",
          },
          {
            capabilities: {
              tools: {},
            },
          }
        );
        server.onerror = (error) => console.error("[Error]", error);
        await setupServerHandlers(server, tools);
    
        process.on("SIGINT", async () => {
          await server.close();
          process.exit(0);
        });
    
        const transport = new StdioServerTransport();
        await server.connect(transport);
      }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Delete' implies a destructive operation, it doesn't specify whether deletion is permanent or reversible, what permissions are required, whether there are confirmation steps, or what happens to related data. This is inadequate for a destructive tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. It's appropriately sized for a simple tool and gets straight to the point without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive deletion tool with no annotations and no output schema, the description is insufficient. It doesn't explain what 'data' means in this context, what the deletion consequences are, what gets returned (if anything), or how this differs from other data manipulation operations. The minimal description leaves critical gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents the single 'id' parameter completely. The description doesn't add any parameter information beyond what's in the schema, meeting the baseline expectation when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Delete') and target resource ('data from the Ucode Items API'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'update_data' or 'post_data' beyond the different action verb.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus alternatives like 'update_data' or 'get_data'. The description doesn't mention prerequisites, consequences, or appropriate contexts for deletion versus other operations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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/Ucode-io/mcp-server'

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