Skip to main content
Glama

update_correspondent

Modify correspondent details in Paperless-NGX by updating the ID, name, match criteria, and matching algorithm for improved document organization.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
matchNo
matching_algorithmNo
nameYes

Implementation Reference

  • Handler function that extracts id and data from args, calls PaperlessAPI.updateCorrespondent, enhances the response with matching algorithm details, and returns it as JSON text content.
    withErrorHandling(async (args, extra) => {
      if (!api) throw new Error("Please configure API connection first");
      const { id, ...data } = args;
      const response = await api.updateCorrespondent(id, data);
      const enhancedCorrespondent = enhanceMatchingAlgorithm(response);
      return {
        content: [
          { type: "text", text: JSON.stringify(enhancedCorrespondent) },
        ],
      };
    })
  • Zod schema for input validation of the update_correspondent tool: requires id and name, optional match and matching_algorithm.
    {
      id: z.number(),
      name: z.string(),
      match: z.string().optional(),
      matching_algorithm: z
        .number()
        .int()
        .min(0)
        .max(6)
        .optional()
        .describe(MATCHING_ALGORITHM_DESCRIPTION),
    },
  • MCP server.tool registration for update_correspondent, specifying name, input schema, and handler wrapped with error handling.
    server.tool(
      "update_correspondent",
      {
        id: z.number(),
        name: z.string(),
        match: z.string().optional(),
        matching_algorithm: z
          .number()
          .int()
          .min(0)
          .max(6)
          .optional()
          .describe(MATCHING_ALGORITHM_DESCRIPTION),
      },
      withErrorHandling(async (args, extra) => {
        if (!api) throw new Error("Please configure API connection first");
        const { id, ...data } = args;
        const response = await api.updateCorrespondent(id, data);
        const enhancedCorrespondent = enhanceMatchingAlgorithm(response);
        return {
          content: [
            { type: "text", text: JSON.stringify(enhancedCorrespondent) },
          ],
        };
      })
    );
  • Low-level API method in PaperlessAPI class that sends PUT request to update correspondent via HTTP.
    async updateCorrespondent(
      id: number,
      data: Partial<Correspondent>
    ): Promise<Correspondent> {
      return this.request<Correspondent>(`/correspondents/${id}/`, {
        method: "PUT",
        body: JSON.stringify(data),
      });
    }

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/baruchiro/paperless-mcp'

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