get_return
Retrieve detailed information about a specific return by providing the return ID using the ShipBob API MCP Server. Simplify return management for e-commerce fulfillment.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| returnId | Yes | The ID of the return to retrieve |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"returnId": {
"description": "The ID of the return to retrieve",
"type": "string"
}
},
"required": [
"returnId"
],
"type": "object"
}
Implementation Reference
- src/tools/return-tools.js:39-53 (handler)The handler function that implements the core logic of the 'get_return' tool: retrieves specific return details by ID from ShipBob API and formats as JSON response or handles errors.handler: async ({ returnId }) => { try { const returnData = await shipbobClient.getReturn(returnId); return { content: [{ type: "text", text: JSON.stringify(returnData, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving return: ${error.message}` }], isError: true }; }
- src/tools/return-tools.js:36-38 (schema)Zod schema defining the input for the 'get_return' tool: a required string 'returnId'.schema: { returnId: z.string().describe("The ID of the return to retrieve") },
- src/tools/return-tools.js:33-55 (registration)The full tool object definition for 'get_return', including name, description, schema, and handler reference, which is part of the exported returnTools array used for registration.{ name: "get_return", description: "Get details of a specific return by ID", schema: { returnId: z.string().describe("The ID of the return to retrieve") }, handler: async ({ returnId }) => { try { const returnData = await shipbobClient.getReturn(returnId); return { content: [{ type: "text", text: JSON.stringify(returnData, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving return: ${error.message}` }], isError: true }; } } },
- src/server.js:55-55 (registration)Registers the returnTools array (containing the 'get_return' tool) with the MCP server via the registerTools utility.registerTools(returnTools);
- src/api-client.js:136-138 (helper)ShipBobClient helper method called by the tool handler to perform the actual API GET request for a return by ID.async getReturn(id) { return this.request('GET', `/returns/${id}`); }