unserializable-type-handling

Community

Expose PowerShell commands safely to MCP

Authorusepowershell
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Many PowerShell commands include parameter types that cannot be represented in JSON Schema, causing MCP tool generation to fail or produce invalid schemas; this skill defines a safe fallback strategy to keep compatible parts of commands available to AI clients while avoiding crashes.

Core Features & Use Cases

  • Tiered Fallback Logic: Silently drop optional parameters that are unserializable, skip parameter sets when mandatory parameters are unserializable, and skip the entire command only if no viable parameter sets remain.
  • Robust Type Detection: Identify PSObject, ScriptBlock, System.Object, pointer/by-ref types, delegate/stream/waithandle/runspace types, assemblies, PowerShell instances, and arrays thereof as unserializable.
  • Safe Failure Modes: Emit warnings and return a false status from GenerateMethodForCommand rather than throwing exceptions, preserving server stability and observability.
  • Use Case: When exposing a mixed-parameter cmdlet to MCP, automatically remove or skip only the problematic parts so AI agents can still use the remaining valid parameter sets.

Quick Start

Generate MCP tool schemas for a PowerShell command while skipping optional unserializable parameters and skipping parameter sets that contain mandatory unserializable parameters.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: unserializable-type-handling
Download link: https://github.com/usepowershell/PoshMcp/archive/main.zip#unserializable-type-handling

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.