Skip to main content
Glama

list_returns

Retrieve and filter return data from ShipBob's fulfillment system by status, date range, or pagination to monitor and manage e-commerce returns.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number for pagination
limitNoNumber of returns per page
statusNoFilter by return status
startDateNoStart date for filtering (YYYY-MM-DD)
endDateNoEnd date for filtering (YYYY-MM-DD)

Implementation Reference

  • The main handler function that implements the logic for the 'list_returns' tool. It fetches returns from ShipBob API using shipbobClient.getReturns and formats the response as JSON or handles errors.
    handler: async ({ page, limit, status, startDate, endDate }) => {
      try {
        const params = { page, limit, status, startDate, endDate };
        const returns = await shipbobClient.getReturns(params);
        return {
          content: [{ 
            type: "text", 
            text: JSON.stringify(returns, null, 2)
          }]
        };
      } catch (error) {
        return {
          content: [{ type: "text", text: `Error listing returns: ${error.message}` }],
          isError: true
        };
      }
    }
  • Zod schema defining the input parameters for the list_returns tool, including optional pagination, filtering by status and date range.
    schema: {
      page: z.number().optional().describe("Page number for pagination"),
      limit: z.number().optional().describe("Number of returns per page"),
      status: z.string().optional().describe("Filter by return status"),
      startDate: z.string().optional().describe("Start date for filtering (YYYY-MM-DD)"),
      endDate: z.string().optional().describe("End date for filtering (YYYY-MM-DD)")
    },
  • src/server.js:23-32 (registration)
    The registerTools function used to register all tools from the returnTools array, including list_returns, by calling server.tool with name, schema, handler, and description.
    const registerTools = (toolsArray) => {
      toolsArray.forEach(tool => {
        server.tool(
          tool.name,
          tool.schema,
          tool.handler,
          { description: tool.description }
        );
      });
    };
  • src/server.js:55-55 (registration)
    Specific registration call for the returnTools array containing the list_returns tool.
    registerTools(returnTools);

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/mattcoatsworth/shipbob-mcp-server'

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