Skip to main content
Glama

keychain_update_item

Modify specific fields of a vault item by its ID, such as login credentials, notes, or organizational details, to keep stored information current and accurate.

Instructions

Update selected fields of an item by id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
patchYes

Implementation Reference

  • The "keychain_update_item" tool corresponds to the "update_item" registered tool in "src/tools/registerTools.ts", which updates vault item fields using the SDK's updateItem method. The tool is invoked using the configured tool prefix (typically "keychain").
      `${deps.toolPrefix}.update_item`,
      {
        title: 'Update Item',
        description: 'Update selected fields of an item by id.',
        inputSchema: {
          id: z.string(),
          patch: z.object({
            name: z.string().optional(),
            notes: z.string().optional(),
            favorite: z.boolean().optional(),
            folderId: z.union([z.string(), z.null()]).optional(),
            collectionIds: z.array(z.string()).optional(),
            login: z
              .object({
                username: z.string().optional(),
                password: z.string().optional(),
                totp: z.string().optional(),
                uris: z
                  .array(
                    z.object({
                      uri: z.string(),
                      match: uriMatchInputSchema.optional(),
                    }),
                  )
                  .optional(),
              })
              .optional(),
            fields: z
              .array(
                z.object({
                  name: z.string(),
                  value: z.string(),
                  hidden: z.boolean().optional(),
                }),
              )
              .optional(),
          }),
        },
        _meta: toolMeta,
      },
      async (input, extra) => {
        if (isReadOnly) return readonlyBlocked();
        const sdk = await deps.getSdk(extra.authInfo);
        const patch = input.patch as UpdatePatch;
        if (patch.login && Array.isArray(patch.login.uris)) {
          // Accept a couple of common match aliases at the MCP boundary.
          patch.login.uris = normalizeUrisInput(
            patch.login.uris as unknown as {
              uri: string;
              match?: UriMatchInput;
            }[],
          ) as typeof patch.login.uris;
        }
        const updated = await sdk.updateItem(input.id, patch);
        return {
          structuredContent: { item: updated },
          content: [{ type: 'text', text: 'Updated.' }],
        };
      },
    );

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/icoretech/warden-mcp'

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