Skip to main content
Glama
op-enny
by op-enny

fakestore_delete_cart

Remove a shopping cart from the Fake Store API MCP Server by specifying its ID. This tool simulates cart deletion for e-commerce testing and development purposes.

Instructions

Delete a cart (simulation - does not persist)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesCart ID to delete

Implementation Reference

  • The core handler function that validates the input cart ID and performs the deletion by calling the del API utility on `/carts/${id}`.
    export async function deleteCart(args: { id: number }): Promise<Cart> {
      const { id } = args;
      validatePositiveInteger(id, 'Cart ID');
      return del<Cart>(`/carts/${id}`);
    }
  • The input schema and metadata definition for the fakestore_delete_cart tool within the cartTools array.
    {
      name: 'fakestore_delete_cart',
      description: 'Delete a cart (simulation - does not persist)',
      inputSchema: {
        type: 'object',
        properties: {
          id: {
            type: 'number',
            description: 'Cart ID to delete',
          },
        },
        required: ['id'],
      },
    },
  • src/index.ts:40-44 (registration)
    The tool listing handler that registers the fakestore_delete_cart tool by including it in the cartTools array.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [...productTools, ...cartTools, ...userTools],
      };
    });
  • src/index.ts:161-166 (registration)
    The execution dispatch in the CallToolRequest handler that routes calls to fakestore_delete_cart to the deleteCart function.
    if (name === 'fakestore_delete_cart') {
      const result = await deleteCart(args as { id: number });
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
      };
    }
  • The del utility function used by the deleteCart handler to make the HTTP DELETE request to the FakeStore API.
    export async function del<T>(endpoint: string): Promise<T> {
      try {
        const response = await api.delete<T>(endpoint);
        return response.data;
      } catch (error) {
        throw handleApiError(error);
      }
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool deletes a cart and adds crucial context that it's a simulation that 'does not persist', which helps the agent understand this is a non-destructive or temporary operation. However, it lacks details on error handling, response format, or side effects, leaving gaps in behavioral understanding.

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 extremely concise and front-loaded, consisting of a single sentence that directly states the action and key behavioral trait ('simulation - does not persist'). Every word earns its place, with no redundant or unnecessary information, making it efficient and easy to parse.

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

Completeness3/5

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

Given the tool's complexity (a deletion operation with 1 parameter), no annotations, and no output schema, the description is minimally complete. It covers the basic purpose and a critical behavioral note (simulation), but lacks details on return values, error cases, or interactions with sibling tools. This is adequate for a simple tool but leaves room for improvement in guiding the agent fully.

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?

The input schema has 100% description coverage, with the 'id' parameter clearly documented as 'Cart ID to delete'. The description doesn't add any additional meaning beyond this, such as format examples or constraints. According to the rules, with high schema coverage (>80%), the baseline score is 3 when no extra param info is provided in the description.

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 resource ('a cart'), making the purpose understandable. It distinguishes itself from sibling tools like 'fakestore_get_cart' by specifying deletion rather than retrieval. However, it doesn't explicitly differentiate from other deletion tools like 'fakestore_delete_product' or 'fakestore_delete_user' beyond the resource type.

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?

The description provides minimal guidance, only implying usage for deleting carts. It doesn't specify when to use this tool versus alternatives like 'fakestore_update_cart' for modifications or 'fakestore_get_cart' for viewing, nor does it mention prerequisites such as needing a valid cart ID. No explicit when-not-to-use or alternative recommendations are included.

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

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/op-enny/mcp-server-fakestore'

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