Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions PaperlessMCP/Models/Tags/Tag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public record Tag

[JsonPropertyName("owner")]
public int? Owner { get; init; }

[JsonPropertyName("parent")]
public int? Parent { get; init; }
}

/// <summary>
Expand All @@ -57,6 +60,9 @@ public record TagCreateRequest

[JsonPropertyName("is_inbox_tag")]
public bool? IsInboxTag { get; init; }

[JsonPropertyName("parent")]
public int? Parent { get; init; }
}

/// <summary>
Expand All @@ -78,6 +84,9 @@ public record TagUpdateRequest

[JsonPropertyName("is_inbox_tag")]
public bool? IsInboxTag { get; init; }

[JsonPropertyName("parent")]
public int? Parent { get; init; }
}

/// <summary>
Expand Down
12 changes: 8 additions & 4 deletions PaperlessMCP/Tools/TagTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,17 @@ public static async Task<string> Create(
[Description("Hex color (e.g., '#ff0000')")] string? color = null,
[Description("Match pattern for auto-tagging")] string? match = null,
[Description("Matching algorithm (0=None, 1=Any, 2=All, 3=Literal, 4=Regex, 5=Fuzzy, 6=Auto)")] int? matchingAlgorithm = null,
[Description("Is inbox tag")] bool? isInboxTag = null)
[Description("Is inbox tag")] bool? isInboxTag = null,
[Description("Parent tag ID for hierarchical tags (optional)")] int? parent = null)
{
var request = new TagCreateRequest
{
Name = name,
Color = color,
Match = match,
MatchingAlgorithm = matchingAlgorithm,
IsInboxTag = isInboxTag
IsInboxTag = isInboxTag,
Parent = parent
};

var result = await client.CreateTagWithResultAsync(request).ConfigureAwait(false);
Expand Down Expand Up @@ -112,15 +114,17 @@ public static async Task<string> Update(
[Description("Hex color (e.g., '#ff0000', optional)")] string? color = null,
[Description("Match pattern (optional)")] string? match = null,
[Description("Matching algorithm (optional)")] int? matchingAlgorithm = null,
[Description("Is inbox tag (optional)")] bool? isInboxTag = null)
[Description("Is inbox tag (optional)")] bool? isInboxTag = null,
[Description("Parent tag ID for hierarchical tags (optional)")] int? parent = null)
{
var request = new TagUpdateRequest
{
Name = name,
Color = color,
Match = match,
MatchingAlgorithm = matchingAlgorithm,
IsInboxTag = isInboxTag
IsInboxTag = isInboxTag,
Parent = parent
};

var tag = await client.UpdateTagAsync(id, request).ConfigureAwait(false);
Expand Down